We have changed the theme to the default twenty twenty-two theme.
We have disabled all the plugins on the site down to just three.
Ultimate Member Version 2.3.1 by Ultimate Member | Auto-updates disabled
WooCommerce Version 6.2.0 by Automattic | Auto-updates disabled
WP Mail SMTP Pro Version 2.6.0 by WPForms | Auto-updates disabled
Still we are just getting the 404 error instead of a custom message or redirection to the login page.
Any other thoughts?