The roof surface itself can do most of the work, but the subfloor is there to catch any possible leaks that might slip through the shingles. House wrapping works similarly to the lower layer of roofs, but instead for cladding. As Piffin said, it won't do any good, but it won't do any harm either. The material is not recommended on roofs mainly because it is a fall hazard: it is more slippery than felt and can break and slip suddenly.
The main purpose of using a home wrap is to prevent moisture from entering the wall cavity from outside. While it's water resistant, a home wrap isn't usually waterproof or waterproof. If the house envelope becomes impermeable, it can cause putrefaction and mold growth in the wall cavity. The main advantage of home wrap, over felt paper, is the greater strength and durability of household wrapping.
Housewrap, a common type of weatherproof barrier (WRB), is installed between the siding layer and the cladding, while roof subfloors are placed directly under shingles or other roofing material, forming a second line of defense against the elements. For example, if your house has a “picture frame” window construction (which is where the windows are framed with tied wood before the windows are installed), some contractors may recommend that the rigid foam be placed with the house wrap first. Mike, my pole barn has a radiant reflective barrier between the straps and the steel roof, but it doesn't have protective wrap on the walls. Usually, house wrap is already added to your garage at the same time as it is added to your house during construction.
I've seen cases where people have applied household wrap directly between roof straps and roof steel, in an effort to control condensation. My building with a pole structure has no wall cladding and I would like to avoid removing the metal to install the house cladding. The house envelope is quite permeable; any warm, humid air that rises to it will pass through the underside of the steel roof and condense.