It seems you're forgetting that everything is buffered and all events are timecoded. This is how pretty much all music software works, and it means the final audio is synchronized down to sample precision, regardless of any hardware latency. If the hardware is too slow and you're doing realtime, the audio will stutter, but this doesn't affect timing precision within the audio stream.
For example, when a VST plugin is asked to process a block of audio, it receives a buffer and an array of events with their exact positions in the buffer. All components are connected to each other in this manner. So even if you're using a slow language, timing will definitely not be randomized, though perhaps, as you add more code, you will reach the point where it's too slow for realtime slightly earlier than if you were using a highly efficient compiled language.