I know. I am telling you why the laws were created on the first place. Nobody though about putting an exception.
And frankly, even if they did think about it, they would probably still do the same, to avoid the legal loophole of local companies using a foreign employer of record to hire cheaper foreign workers.
For every petit-bourguoise privileged nomad software engineer there are thousands of potential low-skill foreign workers that companies are eager to employ to pay less and circumvent local worker protection laws.
All the fiscalization and enforcement structure along with the law is designed for this use case and any seemingly innocuos exception on the law can be exploited by bad actors, so, govern are relutant to do so just because a few rich kids from sillicon valley want to play modern colonial dandy.