fixed it..
it was a site that had been running on php7.4 because the old theme wouldn't work on anything newer..
an updated version of the theme destroys the whole layout..
was trying to see if i could get it updated and working properly without a major redesign which the client wouldn't pay for, but it looks like the enhance / wp SSO didn't like a few things..
firstly.. the theme was doing some strange things and there was a translation plugin that was apparently getting called too early, (Function _load_textdomain_just_in_time ) so that was doing stuff before any user checks.
and there were if statements in wp_config.php to use 127.0.0.1:3306 if wp-cli was being used, otherwise use localhost for the db host...
so a few different things needed to be worked on..
the site was loading though, and backend access was fine, so i expected wp-cli (and sso) to work ok.
once i got past all that i wanted to test the push live / clone site function as well, which all seemed fine, completes without errors, but the app url shown in the panel ui wasn't changing, even if i edited it manually, it just went back to showing the original site url. and trying the sso, it tried logging into the original site, but failed.
and trying to browse to the new site loaded the original url, wget showed the new url was 301 redirecting to the old url, and cookies were also trying to use the old domain. really odd, even checked the home and site_url in wp_options on the new db.. they'd been changed to the new url.. so really confusing.
decided to remove all caching from the site, just in case...
turns out the push live / clone function in enhance doesn't like it when the site is using the 'redis object cache' plugin.
deactivated and removed that and tried again and it all worked...
so yeah, lots of fun and games today trying to resolve all that..
the redis object cache plugin is definitely something to watch out for... might be worth showing a warning in the gui that it can interfere with the cloning process.