That's some fairly nasty corruption.
The printout for the "-d 3" flag happens in the core process. Since it doesn't show the same charset corruption that you get in the Pd console, I'd guess that something either in the socket sender or the tcl receiver is corrupting the data.
If I had to guess, I'd say memory corruption somewhere in the s_inter.c code that sends a buffer of data off to the GUI over the socket. I'd also guess the problem lies in a branch of code that doesn't get triggered until Pd collects more data to send to the GUI than can fit in a single packet. In any case, valgrind
can probably help pin it down.
If you want, you can try running your patch in Purr Data:
https://github.com/jonwwilkes/purr-data/releases
If you still get a similar problem, then this is probably a bug that's been around for awhile.