If a car was wrecked just before it was to be repossessed is it legal to collect the insurance claim and then turn the vehicle over to the bank?

You can collect it if you want, because the lienholder is going to charge you for not having insurance for as many months as they can, and the amount of what it will cost to get the vehicle repaired. I say give them the check, you will owe less.