While this is flying under the radar, this is not legal in pretty much all jurisdictions. You are an employee and using a company to contract services. It is not legal even if you were both based in the same country.
I have a few different clients who I do work for and actively market my services.
IANAL, but I've been freelancing for years and had a similar thing come up. In the end I was found compliant with the law, ie: not in disguised employment.