That is actually how trademark already works, if you have enough money. E.g. well funded brands like Coke, Google, Facebook, can easily use trademark to retroactively remove rights to a name from anyone who wasn't actively using it for some non-squatting purpose - within certain trademark and legal scopes.
Doesn't matter if someone simply owned property with that name prior to the trademark. The test is more complex than that.
I am not sure if UK or US law will apply but in Commonwealth countries there is a clause in trademark law called Prior Use.
Basically if you are using an unregistered-trademark which is then later registered you are not considered to be infriging if you have been using this trademark before the trademark was registered.
Cyber squatting laws specifically call out that you need to have obtained the name with ill intent (i.e with intent to ransom it to an already registed trademark holder).
So no, that is not how trademark works, atleast in the codes of law I am familiar with.