Does homeowners insurance cover an uninsured person?

My agent in MD (at the time-10 yrs ago) advised me that my homeowners insurance would not cover workers who by law were supposed to be covered by worker's compensation. I had a very skilled, reliable friend who would have installed a large roof for me for half the price of a fully licensed contractor who gave me proof of being in compliance with all licensing and insurance requirements.
To the best of my knowledge in the three states in which I have lived, maintaining a valid contractor license does not include a requirement to maintain valid worker's compensation insurance.
The chances of having a serious problem in these issues is relatively small but the risk of paying the expenses of someone seriously injured (maybe for the rest of the injured party's life) is huge.
On another question site, a person said that they had a special insurance policy to cover the risk of having others do work on their property but I have not been able to find a company that sells anything like that person described.
If you search "worker sues homeowner" you will find numerous articles to read about. I read of one where the hospital sent their big bill directly to the homeowner after it became clear that there was no other means of getting their bill paid.