The issue was happening in Ghostty, iTerm2, and Terminal.app. It happened by (a) pasting directly into the terminal prompt with Command-V, (b) using `pbpaste` in any way (like piping it into `wc -c`), or (c) pasting into an editor like Neovim with Command-V.
It doesn't happen with any other file I tested it with. It also doesn't happen if I try to paste into another app, like Visual Studio Code, TextEdit, or IntelliJ IDEA itself.
Nothing is inherently wrong with the binary/text content of the file. It's all ASCII characters.