Sorry to hear. Serious bad luck. Saw it happen a fair bit when I was at vicroads. One case a guy bought a car for $45,000 then found $30,000 was still owing... he, understandably, wasnt happy. Especially after he was told there was nothing owing. He was somehow under the impression that verbal check would be enough.
There are steps involved, however it is the responsibility of the buyer to do the check. Vicroads has a Vehicle Securities Register (VSR) which holds information about encomberances on vehicles. Its not the most reliable source tho because there is no law forcing financiers to use this register so it only holds about 85% of all encomberances. Obviously the a verbal check over the phone is not really enough. However, you can purchase a VSR Certificate, which is a legally binding document, that will protect you from any hidden encomberances (i.e. not recorded on the register) for the period that you own the vehicle. Then when the bank comes round and says "give me the car" you show the certificate and can tell em to get stuffed.
If you purchase a car from a LMCT then you are automatically covered. By law, it is the LMCT's responsibility not to sell cars that are under finance.
The certificate will not protect you if the car is stolen or has been rebirthed. I dont know if there is any cover available for this situation.