If you try this sort of thing in Australia, you violate the Alienation of Personal Services Income Act 2000, and will be in a world of pain. Many other countries (including e.g. many post-2004 EU members) have similar laws against "stealth" employment, enforced with varying degrees of eagerness and effectiveness, as common in that region.
If you're only serving a single client, you're usually not a contractor. If you pretend to be, and if the tax office ever decides to scrutinize what you do, chances are they'll tear you a new one. Insist on having an "employer of record" that does things by the book, and knows local regulations, tax codes, and mandatory insurances.
I just read an article claiming that in Germany employers of record are treated like temp agencies and thus limited to 18 months.
For example, trying to be a professional soldier in Iceland, or a prostitute in the US, just plain won't work out legally, no matter how complicated the arrangements you make.
And I count myself lucky to live in a country where the people's incentives mostly align with the way I prefer to make a living.
In the same time if your customer does have legal presence in your country of residence then that's entirely different situation amd tax office might see it as tax avoidance, though this will depend on country of your residence as laws are implemented differently in different EU member states, and also the legal form of your own company.
If in doubt, hire accountant who specializes in your area.
Indeed. This should be the top answer to OP's question.
I know this word! Yes, it's a shitty situation :)