1N4937 is a fast recovery diode. UF4007 is the ultrafast version of the 1N4007 which is designed only for general purpose, mains frequency use.
If it works, then it must be luck. If the diode is only used for absorbing spikes then you could get away with it but for something that rectifies the...