I can actually tell you what is going on here! Thanks to the wonders of YouTube.
In the US, it is common to have double outlets, where one outlet is permanently on, but the other is switched by a light switch (they call it half-hot). You would then plug in a floor lamp into the correct outlet, and you can then turn on your floor lamps with a switch by the door. Pretty useful in a culture where bringing your own lamps to a rental place is common
Of course you shouldn’t be switching lights in a completely different room, but who hasn’t done that. In the house I grew up in, the light switch for the kitchen back porch light was in the garage, which was adjacent to the kitchen, but you still had to go into another room to actually use it.
My father wired it. I think it was a simple matter of forgetting to install a wall box for the switch, and that’s just how it was done temporarily, and then it became permanent.
I have a similar non-functioning switch in my own home. After some time, I discovered it feeds a Euro-style outlet on the back patio. The previous owner had a tree decorated with Christmas lights plugged into it. So that light switch… was for the Christmas lights outside. Of course they did it the cheap way by burrying 1.5mm unarmoured twinflex into the garden… so once it started tripping the RCD I simply ripped the whole thing out.
So now I have an outside socket, switched by a light switch in the house