If I type "AT" and I expect a response "OK", then sometimes I receive no response, and other times I receive something like
Your expectations are wrong then.
What you SHOULD expect is that when you send "AT" to the device, nothing will happen immediately. THAT is normal behavior.
At some point in the future, you should get a response. You have no way of predicting how long any given AT command will take to get to the device, or how long that device will take to formulate a reply, or how long it will take for the Arduino to get the response. Nor do you know exactly when the response is complete. That seems to me to be a critical flaw in the entire AT command process. Every response should either start with a length or be terminated with some known character.
What you need to do then is either keep track of the commands sent, and the responses received, so you can match them up, and decide what to do next, or you spin for a while after sending each AT command, waiting for a reply (but not waiting forever) or something that indicates that the response is complete. For every AT command, what constitutes "response is complete" could be different.
How long to wait for a response is up to you, and might be different for each AT command.
What you can NOT do is send a bunch of AT commands, ignoring any response from the device. Which is what you are doing.