Are we required to gain access to locked garden sheds to inspect their interior? Does attachment to house play a role?

If it’s just a storage shed, then it’s not part of my inspection. That doesn’t mean I won’t do a quick once or twice around and give them some verbal feedback.

If there is electric in it, then you may want to look at it. Some rural, older homes may have the pressure tank, and systems in a building. On occasion the well may be there also.

If it is attached to the house, is it really a shed, or part of the house?
Recently, I found the pressure tank and filter in an outside “closet” attached to the house. Insulated, however I found an electric baseboard heater with the shield/cover missing, wires disconnected and wire nutted.

You just have to play it by ear as you go.

I agree with Greg, If I can get in, I do, but I make a comment on the shed in my report, but it also states that a shed in any condition isn’t a major item and not considered a component of the home.