The Door Close button is not for you. It's for when the elevator is in an override mode, like when there's a fire, or when someone is moving something large in the elevator.
If you have the right key, you can turn the switch to a mode like "Fire" or "Independent," during which the doors do not automatically open and close. This is so the elevator can be moved to a particular floor, ignoring all of the other elevator requests, and the door only opened and closed when the keyholder wants it.
There are some building owners who configure the Door Close button to respond to pushes. But they're not common.
/I briefly worked for a large apartment complex, and had to assist people moving in and out of the buildings.
[0] https://www.ultimatesecuritydevices.com/Original-OTIS-UTA-ke...
[1] Americans with Disabilities Act
As the other replies have said, the button isn't for you, but it does have the psychological side effect of giving you a feeling of control over your experience, which can help quell anxiety. This is also the reason mirrors are common in elevators; the space feels much bigger and less claustrophobic, and you can waste a few seconds while you check yourself out in the mirror which makes the trip feel faster.
However, the button will usually work in a hospital, as they want the door to be open for a long enough period that people who are less mobile can enter before the door closes, but at the same time there are often urgent situations where seconds count, so you need to be able to get the door closing faster in an emergency.