Yet you missed the parts about formatting your posted code as per the Welcome Topic, I fixed that.
And NOT posting your AUTH so others here can mess with your project I fixed that as well but you might want to change it.
Also about NOT calling out regulars to look at your code… everyone, including us, will see it eventually anyhow.
As for your issue… yes there are many topics about using an ESP as a shield for Arduino. And since you did get connected at least once, your pinouts should be fine. Perhaps look at the guidelines about proper power for the ESP as well.