DM should have rolled for the player secretly if they didn’t want to call attention.
It depends on your table, but I disagree.
If I ask the party for a perception check and they all fail the party should be aware of their choices (in this case, perception is important). If I then surprise them with an enemy they are clear why that happened.
Alternatively in this case it’s to locate something, maybe they want to spend a luck point, flash of genius, or other similar ability.