I mean, that's the very reason why DM/GM screens exist, and why are they demanded product.
DM/GM always should be aware about 'secret checks", and that he should, and when he should make those. And no player can see the result.
Party walk into the room - DM/GM checks what everyone's perception is - and roll perception FOR THEM.
DM doesn't roll for them.
DM just uses the flat passive perception scores they have that don't come from rolls.
Passives aren't supposed to be rolled, the score is just high enough to beat DC or it's not. Rolling is only for actively done things.
Depends on what game, and what edition of it you are using. Although passive perception in 5e tbh is dumb. Basically, game says that if you never gonna try perception roll yourself - you get 10. But if you try to roll for it - you can get result below 10 o_O
It should have been either passive equqal to 1+WIS+Proficiency. And all DCs adjusted for that. Or active roll is D10 instead of D20, and that D10 added on top of your passive of WIS+Prof+10.
Even better option - perception is always passive only. And if you convinced there actually something in the room (maybe you get a vague answer from divination, or got vague information from city informants about treasures hidden somewhere in dungeon, you are just not sure where exactly) - then you call for investigation activity, and roll for investigation check instead.