This is a good point. Which is why I’m a big fan of general workers’ solidarity, including via unionization.
Solidarity among workers offers us a tool to combat these companies, and force them to make changes that benefit us at the cost of their shareholders. The union should be able to lobby the government to enact and enforce sufficient safety laws such that a worker will never be changing the roof over night unless adequate safety standards are met. And if a company fails, a worker has the means to refuse the work, regardless of the size of the company.
With solidarity we simply don’t have to wait for these companies to stop on their own, because we can collectively force them to stop, bottom up.