The ending people are complaining about is literally labeled "SadEnding" in the code. It's not the 'real' ending like some people are claiming. Yes, it's abrupt and doesn't really have anything to do with MC agency/choice, and is not a very well-written ending because of that... But people are making assumptions as if the events that happen on every path are somehow true, which is pretty clearly not the case.
It's only the ending if the player chooses that that's the ending, by answering the door. If the player doesn't answer the door, that path does not happen, and the things the character on that path says aren't somehow still true. Other than on that path, there aren't any hints about the game being the MC's delusion. Characters (who that ending claims are delusions) interact and talk outside of the MC's presence throughout the game and the other endings, and have agency of their own, which isn't going to happen if the whole game was the MC's delusion.