Does anyone have experience dilligencing if companies are appropriately employing staff to comply with IRS and legal guidelines?

I am looking at a company that has almost all 1099s and when I read the IRS guidelines on employment classification, it seems like they should all be W2. However, it also seems like there are a lot of loopholes or gray areas to get around it.

This could be driving inflated margins and lead to potential liabilities down the road. Even if we trade on the purchase price to account for the new costs associated with W2 employees, would there still be liabilities / legal risk from historical employment practices with an asset sale structure?