Scrying a location does not automatically allow you to see hidden creatures
Scrying says:
You can see and hear through the sensor as if you were there.
So, yes, a perception check would be required to detect a hidden creature, per the rules for hiding.
Regarding a defense mechanism
You would need to consult the description of the defense mechanism, but broadly, it seems reasonable that a scrying defense mechanism would "see and hear through the sensor as if it were there".
Scrying a creature
You raise a good point with quote you highlighted from the scrying spell:
You can see and hear a particular creature you choose that is on the same plane of existence as you.
Scrying does not say it grants special senses to see the unseeable and hear the unhearable. The DM would need to make a ruling. To my mind, scrying an invisible creature, you see the location where the creature is, but it is still invisible. Likewise, scrying a hidden creature, you would see the area where they are hidden, but an actual check would be required to actually see them, perhaps with advantage, since you're sure they're there. A DM could reasonably decide the other way; in any case, the rules don't provide a clear resolution, so the DM needs to decide.