Well, if there's a prohibition it wouldn't be in the electrical code.
I think it probably depends on:
-what the fire code may say about access to skylights on this type of occupancy
-whether there's another code section that requires the skylight to be there (i.e. if there isn't, then okay to cover it?)
When you say an ag building I'm imagining most likely a corrugated metal roof with plastic skylight material of matching profile. And I'm asking myself is there any important difference between the skylight being covered by solar panels and it not being there in the first place. If not, I'd argue it's okay to fly over.