Found a solution!
The issue was that the device did not have enough time to react to the initial command after opening of the COM port. I put time.sleep(2) after creating Serial object and everything works as it should.