You are right but a lot of the time you are not facing that kind of enemy sometimes they will do something to confirm their presence when you shell or hose down the building they are in. On top of that the mere act of shelling or firing on the area itself changes the situation to one where you can might gain more information*.
It also depends on what form the enemy takes, yes an good infantry squad might hunker down and ride it out (not having many other options), but what if it's a recon unit who might think they have been spotted they may well scoot, hell it may be other unit that rely on scoot as part of their tactics.
On top of that we know it's recon by fire just to see, but the other side don't always know that and sometimes it hard to tell the difference when the walls and ceiling are shaking
Basically while you are right in principle and certainly right about the only way to be 100% sure is to send in boots, but in practice there is a lot of 'just give that thing a burst or a round and see what happens', because a lot of the time you are trying to bait teh opposition into doing something. and teh ting is about sending in boost it it happens in wider context, you are committing to an action are you actually in a position to that, do you have higher priorities on you to do list that will get in the way of it, and so on.
And finally there is the question of just basic time, there could be a lot of possibles you might want to investigate and you just don't have the time to send a squad for each one every time
Also as aside infantry retreating to a basement to hide from artillery is fine until the building take a round and potentiality collapse enough to block your escape.
*sadly a classic is send civilians in the area running grab one ask who is in the area, and especially that if you know where your real target is you stop taking more general potshots