SSH connections disconnect on macOS Sequoia when the macOS firewall is enabled:
https://discussions.apple.com/thread/255761702
The error looks like:
Bad packet length 2489765067.
ssh_dispatch_run_fatal: Connection to <ip address> port 22: Connection corrupted
I just ran into this and thought this was a server issue before I found that Apple Support Community thread, but it’s actually a macOS bug.
Disabling the firewall fixes the problem.