From what you are describing, you have all of the symptoms that you have lost a phase and it may not be the range circuit. It could be the main breaker or service conductors.
I would start by disconnecting the range and the oven then I would carefully open the panel covers and check to see if you are reading a nominal 240V across the output of the range breaker and checking the buses in the panel to see if you are getting a 240V reading above and below the main breaker in the panel. If you are getting a nominal 240V reading at all of these locations. Then check the circuit to the range and ovens and see if they match the panel or have dropped a phase. This might not fix the problem but you are trying to isolate the location of the problem.
There are a few comments I would also like to make about your circuit to the range.
First it is allowed by the NEC to split your range circuit to feed both a range and an oven.
Second a 40A breaker that feeds the circuit is not common in a residence. It is usually a 50A or minimum 45A breaker being fed by a #8 or #6 conductors. The size of the conductors are critical to the correct operation of the circuit and this may have even had something to do with the range shorting out. More imortant it may shorten the life of your new equipment due to voltage drop and improper voltage at the equipment.
Third and the really bad news. Your statement:
wiring is messed up and definitely needs to be rewired, however that option is quite impossible in the moment.
That may have been true yesterday but may not be true today. The time to begin correcting the wiring may have already started or you could be facing more problems including possible burn and shock hazards. You may be able to phase in certain corrections first, but you need to consider permanent repairs instead of trying to bandage your system until later.
Hope this helps, stay safe and good luck.