Please head over to WordPress Dashboard > Settings > Permalinks. Make sure the settings match your preferences.
Then, head over to WordPress Dashboard > Rank Math > General Settings > WooCommerce and disable all options.
If that doesn’t work, please try disabling Rank Math and see if the issue is fixed. If the issue persists, then it is not caused by Rank Math and you will need to disable each plugin one by one to find the problematic plugin.
Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.