"Legal"?
Likely either a breach of contract or just plain unenforceable depending on the terms and conditions of the contract.
Something like that should have been addressed in the contract when it was first signed.
The way I have bought houses is to address it in the Close of Escrow details, stating that my final walkthrough will occur on the morning of the Close of Escrow with the home and property unoccupied, all of seller's belongings removed, and all utilities on.
If the seller doesn't comply, I don't close and the seller doesn't get any money until the seller is completely out.
Do you have some reason to suspect that the seller won't be out by Close of Escrow?
What you propose to demand isn't likely to happen if both parties are already in contract.