It’s probably not lawful at all
Your contract of employment is just that, a contract. It sets out your employers rights and yours and the notice period you must give.
Presumably, yours says that you must give one months notice so you are good.
Just to help understanding, imagine what would happen when, if you scale the issue up country wide, may people get sick once having resigned? They would then all have to delay leaving and would then be in breach of contract with place they are going to work at next. An impossible situation to put people in.
Hopefully that helps you clarify in your own 6mind that you don’t have to work beyond your agreed or stated leaving date. If your employer threatens to withhold payment, that is absolutely illegal. If that happens, don’t get involved in a discussion, simply go to citizens advice for guidance.