It depends on the gig. Attempts to farm out housecleaning as a gig fail in exactly that way - people find the cleaner they want, and they arrange to make it permanent.
That used to be considered a success, not a failure.
When agencies like Kelly place someone in a position like that, the person is required to work for Kelly for x number of months/years. Once that obligation is complete, they are free to jump to working directly with the Kelly client. Been there. Done that.
This is a solved problem. And solved a hundred years ago.
Part of that solution is to either sell a cleaning service that people only use occasionally, like deep cleaning of your floors, or to lock the client in to a contract that allows you to detect those private deals.
But the basic, "I'd like someone to clean my house once a week" doesn't work so well. People sometimes stop the cleaning after a bad experience. And sometimes hire the cleaner after a good one. And from the company's point of view, those look exactly the same. Customers will refuse 6 month contracts, and so there is no real recourse.