All tenancy agreements say that about the keys.
But ignore it.
You are protecting yourself, thet for sure will not respect your privacy/boundaries. Your ex has threatened to strip you of your rights to your possessions.
Trust me, i've researched this myself, and used it against the total poisonous bitch from he'll ex-landlady.
If they want a copy of the keys, the worst they can do is take you to court. That'll take months.
If they want you out, make them take you to court. Or you'll ne intentionally homeless and won't ! Be helped by council.
Anything they want you to do. Don't. Make them make you.
Don't budge, don't allow access, don't engage.
get yourself some legal eagles, and please trust me on the keys! Your exbf will not think twice about entering your home.
They won't even know you've changed the locks until they try to gain access anyway, as soon as they've done this, you have the proof you need to justify having changed the locks anyway! Keep the locks and keys and either change back on the day you have to leave, or give them the old locks/keys. Important, as these belong to the LL.