Per RFC1073 section 2, the width and the height are two bytes each, but "any occurrence of 255 in the subnegotiation must be doubled to distinguish it from the IAC character (which has a value of 255).". So we need to send eight 255 bytes for a 65535x65535 terminal, not four.
For some reason, recent versions of Mikrotik RouterOS have started really caring about this.
Per RFC1073 section 2, the width and the height are two bytes each, but "any occurrence of 255 in the subnegotiation must be doubled to distinguish it from the IAC character (which has a value of 255).". So we need to send eight 255 bytes for a 65535x65535 terminal, not four.
For some reason, recent versions of Mikrotik RouterOS have started really caring about this.