Thank you for the suggestions richard.
? I guess you're right about the third point that the connection is lost between the Gateway and the IBKR servers thus is cannot handle API requests hence the error. So I just need to figure out a way to correctly handle this situation.?
? Sry for the inconvience caused by the low quality pictures and again thanks for the help.