It appears that smoltcp does not properly handle an unexpected ACK when in the SYNC-SENT state. This results in the TCP socket being in an unusable state.
These conditions are described here, but the basics are that a previous connection (which was not properly terminated with a FIN) results in the server having some established TCP state (server is in ESTABLISHED).
When the client sends the SYN packet, the server acknowledges with an ACK#x, which is invalid to receive in the SYNC-SENT state. smoltcp should recognize this state and instead send a RST to the server to properly terminate the previous connection. It should then restart the SYN handshake to establish a connection with the server.
Sample of wireshark capture showing the error
