Thanks for the log!
There is a built-in 3-minutes timeout that triggers this error if it was not possible to send data to the client for 3 minutes. The reason for not being able to send data is that the SSH channel’s receive buffer has became full, which in turn indicates that the client stopped adjusting receive buffer size, and that suggests that the client stopped reading the server response. Or, simply said, the server has been trying to send data, but the client was not receiving, so eventually the client-side receive buffer became full, making it impossible for the server to send more data.
Based on the description of what you are doing, it looks like you need to call Scripting.Process() in addition to Scripting.KeepAlive() to make sure that data sent by the server is received and does not remain in the receive buffer until it eventually runs out of space.
(Or use Scripting.ReadUntil/ReadLine/ReadChar to read server output for the command started by your SendCommand call.)