On our development server , we have used (on windows) PostgreSQL 14.2, compiled by Visual C++ build 1914, 64-bit
On our production server, we have used (on linux Centos 7) PostgreSQL 14.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit
We have noticed the difference in behavior while reading column of type BYTEA from our tables
If you can provide a self-contained demonstration of the behavior using a self-contained psql script (show your output of running it via shell on both machines) that would help.