If your productpages and categories give a 404 error, always empty your cache and re-save your permalinks. WordPress will reset all urls at that moment. In 99% of all cases the permalinks will be restored.
Depending on your server and amount of products: this make up to 10-15 seconds(!) Don’t refresh your page, but wait until the proces is finished.
Step 1: https://www.perfectseourl.com/wp-admin/options-permalink.php
Step 2 : Scroll down > click > ‘Save Changes’