Most places they don't prevent what you describe. There are usually just some extra hoops to jump through and/or some tax implications.
E.g. I'm in the UK. I've been a contractor with multiple contracts as well as with a single employer both in situations where they are obviously acting as an employer, and in situations where they were genuinely not.
Here there's specific legislation to handle this now - "IR35", which ensures that if your contract is equivalent to employment you'll be taxed accordingly, with an "umbrella company" acting as an employer on behalf of the company that you're contracting with if that is the case to prevent there from being a tax advantage from pretending to be freelance if you're in effect an employee. It doesn't stop you from doing it - it just takes away the tax advantage and creates some bureaucratic hurdles.
But it's easy to avoid as long as you're not trying to avoid taxes, by setting terms that ensures it doesn't match the criteria. Employers are often keen to do this, and it gives you extra negotiating power.
E.g. when I was doing this, key points involved the fact I had a small marketing budget to bring in additional work, I didn't usually work out of their office, I controlled my own hours, I determined how to carry out the work, I negotiated my day rate, the contract had a defined end-date (we could renew, but there are pitfalls there), and so on. Another strong sign you're genuinely not an employee is a right to substitution (e.g. if you can provide someone else to do the work, when you're not available and that right is genuine). UK tax authorities (HMRC) has a checklist as to what they consider "deemed employment" and or that falls under IR35 (it's not an absolute set of criteria, but basically the more you look like a business, the more likely you are to be considered one).
So for high earners like software consultants with an actual reasonable power balance vs. the other side, this is rarely a problem. It cost me a tiny proportion of my revenues to make sure that I met more than enough criteria to be able to do as I pleased.
But most of the people these regulations are there for are in a substantially weaker position. If you're a low enough earner to not be in a position to work around this, then you're not likely to have the power to genuinely negotiate either.
E.g. I'm in the UK. I've been a contractor with multiple contracts as well as with a single employer both in situations where they are obviously acting as an employer, and in situations where they were genuinely not.
Here there's specific legislation to handle this now - "IR35", which ensures that if your contract is equivalent to employment you'll be taxed accordingly, with an "umbrella company" acting as an employer on behalf of the company that you're contracting with if that is the case to prevent there from being a tax advantage from pretending to be freelance if you're in effect an employee. It doesn't stop you from doing it - it just takes away the tax advantage and creates some bureaucratic hurdles.
But it's easy to avoid as long as you're not trying to avoid taxes, by setting terms that ensures it doesn't match the criteria. Employers are often keen to do this, and it gives you extra negotiating power.
E.g. when I was doing this, key points involved the fact I had a small marketing budget to bring in additional work, I didn't usually work out of their office, I controlled my own hours, I determined how to carry out the work, I negotiated my day rate, the contract had a defined end-date (we could renew, but there are pitfalls there), and so on. Another strong sign you're genuinely not an employee is a right to substitution (e.g. if you can provide someone else to do the work, when you're not available and that right is genuine). UK tax authorities (HMRC) has a checklist as to what they consider "deemed employment" and or that falls under IR35 (it's not an absolute set of criteria, but basically the more you look like a business, the more likely you are to be considered one).
So for high earners like software consultants with an actual reasonable power balance vs. the other side, this is rarely a problem. It cost me a tiny proportion of my revenues to make sure that I met more than enough criteria to be able to do as I pleased.
But most of the people these regulations are there for are in a substantially weaker position. If you're a low enough earner to not be in a position to work around this, then you're not likely to have the power to genuinely negotiate either.