MIDISend not returning error when device is disconnected on macOS

If I physically disconnect a MIDI (USB) device, the MIDI Studio correctly shows the device as offline, yet MIDISend does not return an error when trying to send to this disconnected device.

I realize that MIDISend is deprecated for macOS 11.0 but we need this to work pre-11.0

Is this expected behaviour?

MIDISend not returning error when device is disconnected on macOS
 
 
Q