The 1N400x are 1 amp diodes; 1N5400x are 3 amp diodes. Either will work fine in that application if installed properly, but the 540x will be a bit more physically 'robust'. If you think vibration killed it (unlikely; stressing the lead to package interface during installation is probably what killed it), you can always squirt a dab of E6000 type adhesive (Shoe Goo, etc) between the device & the contactor case to stabilize it.
The last digit is the voltage rating; likely more important than the current rating for this application, since even the 400x will handle 30 amps forward surge for 5 milliseconds. The 4007 carries a 1,000 volt rating, while the 5408 carries a 1,000 volt rating. (Nothing is ever completely consistent....) If you shop for them, you'll likely find very little price difference between a '01' and an '07/08' in either device. In my old electronics repair business 30+ years ago, we just stocked the highest voltage rating to minimize parts inventory.
Charlie