ESP8266 problems

Are you aware that the ESP8266 has more processing power and probably more memory than your Arduino and that it can be programmed with the same Arduino IDE software, using (almost) identical code?
Because of this, the chances are that the Arduino Uno is redundant.
If you’re using the ESP-01 like the one in your diagram (although that’s not clear from your comment about not having the same pin assignments) then you’ve chosen a difficult package to work with. You’d actually be better with something like the Wemos D1 Mini as it has an onboard USB and more GPIO pins available.

If you want to continue with your original setup then I think your issue is with the fact that the Uno only has one serial port. You seem to be using this to connect the Uno to your PC and have it talk to the ESP. You should probably be using Software Serial to talk to the ESP. The correct GPIO pins for this communication are defined in the softwareserial.h library file, but aren’t the TX/RX pins on the Uno.

Pete.