More generally, though, using different code paths for emergency dialing is the root of the problem in the first place—you want to minimise special handling of things like this, because less-tested paths are much more likely to be buggy. Consider also: error handling code is pretty much the buggiest out there, because it’s seldom tested.
Once the software notices one of these numbers dialled call handling will go a completely different code path than normal calls.
I have no idea how things work in Android, where you obviously must have VoIP hooks?
Yes, there's emergency IMS (basically volte/vonr version of SIP) profiles the phone is supposed to register to and all the carriers towers advertise emergency numbers in their signaling.
The problem is when the internet connection is not so stable, and thus VoLTE doesn't work that well. The safer option would be to drop to 3G or even 2G if available to complete emergency calls.
We need to forget about falling back to 3G or 2G as that is not a viable solution in the long run. The carriers and phone manufactures have a responsibility to make emergencies calls work well over VoLTE.
But most places I've lived in the US had a non-emergency police number, and non-emergency 911 calls were very discouraged. If you have a good reason to make them for network or device testing, you'd just need to schedule a time to make a test call, stay on the line and tell the operator, etc.
Device development would be well served by using a tower simulator in a Faraday cage, as a sibling suggested. But a responsible developer would do a few tests on live networks during release acceptance testing.