actually if you add
define('RELOCATE',true);
The Wordpress will be in the relocate mode the next time you visit wp-login.php.
It will reset all the URLs.Documentation: https://wordpress.org/support/article/changing-the-site-url/...