Every time you open and close the serial port, you reset the Arduino. With that code, the Arduino has barely had time to start collecting the input data when you reset it by closing the serial port.
Obviously, it does not have time to collect the data and formulate a reply, let alone send the reply. That is why you can't read the response.