Denied access for essential repair in final week

Had relatively few problems through the year, but tenants found viewings almost impossible to agree. Pulled hens teeth and got 3 separate viewings and thankfully an offer! Then came to my notice back door wasn’t locking. Learnt they have NEVER used the key for this year, just using little catches put on in an emergency following break in - what they thought the key was for have no idea. So now I know insurance would be invalid, and after several emails they still refused entry until after they’ve gone, for repair. I did get an email accepting responsibility from them and clearly stating denial of entry, but if the worst happened no idea if they would actually pay up!
Is there anything else I could have done 10 days before end of tenancy?

Hi. I am no expert but surely no proper lock is an emergency if it is invalidating your insurance?

Hi
A landlord must give 24 hours’ written notice before they can enter a property(except in the case of an emergency) - assuming they are given permission by the tenant - and can only arrange to visit at a ‘reasonable’ time of the day; so ideally not late at night or early in the morning. While tenants hold the ultimate authority to control the access of their home, landlords also have a right to enter, as they need access to uphold their responsibilities for repairs and maintenance and scheduled inspections.
What are legitimate reasons for your landlord’s entry
In your case = Repairs and maintenance – Your landlord is responsible to maintain and repair the property after the tenant reports a problem, or an inspection has detected one. To do that however, the landlord will need to go inside the property.
Landlords have a right to enter the property in cases of emergency
In an emergency, your landlord or their representatives will need immediate access to your home. At such times, they do not need your permission to access the property. This is very rare and usually only happens when safety issues are at stake. For example:

Again in your case = There has been structural damage which urgently needs attention