How can I change WordPress domain from remote to localhost?

Instead of renaming, set up your local web server to handle requests to that domain and modify your local hosts file to associate the domain with ip 127.0.0.1.

Especially when debugging hard to find bugs you will want your enviroment to be as similar to the one of the live site.

(I can do it in a not very modern version of WAMP and therefor I assume you can do it with all similar web servers)