I am an emergency worker and in my state, we CAN do wellness checks that even include breaking into a home.
It is done for supposedly good reasons, so we don't have a legal barrier. We do have to give an opportunity for the person to answer the door, it isn't a search warrant type of situation. But when they don't answer, we are going in.
Clearly, these officers did not spend enough time with you to be sure there wasn't a mental health issue. (Hey, you gotta joke sometimes.)