My name is XXXXX XXXXX I'd be happy to answer your questions today. I'm sorry to hear about your situation.
If the contract requires you to deliver a vacant property, then the buyer is not considered to have possession at a time that your tenants are still living there. That means that the possession is delayed. Because you are the one that has a contract with your tenants, you are the one that can sue them for damages
if they do not vacate on the date they are legally required to do so. That means that you're also the one responsible for making sure they're out. If the tenants are aware that they are responsible for rent each day they remain in the property after July 31, that may inspire them to move out sooner. It also can help offset the costs of what you have to pay the buyers if the tenants don't leave.
If the reason that the lock rate has to be extended is because the tenants are still living in the property, that is something that is attributable to the seller. The party that creates the need for the rate to be extended can be responsible for paying the costs, yes. It's not illegal unless there is specific language in your contract that would make it the buyer's responsibility to pay for it, or unless there was some basis for saying that the buyer created the need for the extension. If you're actually closing before the tenants move, it may not be necessary to extend the rate, so ask for verification or paperwork to show that is happening.
If you have any questions or concerns about what I've written, please reply so that I may address them. It's important to me that you are 100% satisfied with the service I provide. Otherwise, please rate my service positively so that I get credit for answering your question. Thank you.