weird way to fix a broken engine from a owned vehicle

This is nothing new, you may have missed the message or the script may have not detected (but the game itself did) that your vehicle was destroyed, but usually once you cannot drive your vehicle at any point once it's in the water - it is considered destroyed.
As said above, once a vehicle enters water it 'dies'. It can then be recovered for a fee. It would not repair the vehicle. You must have paid for it to be recovered. Tested multiple times and it works as intended.