I had the same issue on my MacBook Pro 15" 2015 for a long time. The built-in speakers initially were working fine up to the point when I decided to stick my headphones in the socket. I wasn't able to do that as the jack was not going in to its full length, just like on the OP's picture above. While figuring it out I was able to put the jack briefly in a position where the headphones would play audio. As soon as I got the jack out though the socket started glowing red and the built-in speakers became off.
I tried a lot of different advices trying to clean a supposedly stuck pin in the socket but to no avail. The red light kept coming out through the lens at bottom of the socket and it was clear there is nothing stuck in there.
What I did eventually was pushing a jack in there really hard while twirling it a little. Not long after I heard some crunching sounds of what I think might've been the lens. I shook it and this is what came out of the socket.
I'm pretty sure it's not some kind of a candy as it is not sweet at all :). It looks like pieces of what might have been the actual lens glass or some kind of intermediary glass.
Anyway, I inserted a toothpick in the socket and tried to get all this crunchy stuff out. As I was doing that I eventually reached deeper and at some point it got unstuck. My built-in speakers went on just fine.
Eventually I was able to insert the jack all the way into the socket. When I take it out my built-in speakers go on. I still get no sound through the actual headphones since when the jack is in, the socket lights up the red light. Probably some stuff is still there and prevents a proper contact with the jack. I'm not bothered by this much as by this time I'm used to my bluetooth headphones. Hope this helps. Cheers to @Kevin Ushey for showing us what's possible :)