In our case, the issue was related to permissions when migrating the database between platforms, dev server to local. The category pages would load, but the product detail page would show 404 without an error.
The cause of our issue is that the data migration was trying to create a view but didn't have the permissions to do so due to how the mysqldump created the query. Navigating to the products page on the backend would show no inventory.
The fix was to create the View manually. Which is super annoying to do every-time you setup a new docker. Below is the query to create the inventory view.
Remember to reindex and clear cache.
php bin/magento indexer:reindex
php bin/magento cache:clear
php bin/magento cache:flush
CREATE
OR REPLACE
VIEW `inventory_stock_1` AS select
distinct `legacy_stock_status`.`product_id` AS `product_id`,
`legacy_stock_status`.`website_id` AS `website_id`,
`legacy_stock_status`.`stock_id` AS `stock_id`,
`legacy_stock_status`.`qty` AS `quantity`,
`legacy_stock_status`.`stock_status` AS `is_salable`,
`product`.`sku` AS `sku`
from
( `cataloginventory_stock_status` `legacy_stock_status`
join `catalog_product_entity` `product` on
(( `legacy_stock_status`.`product_id` = `product`.`entity_id` )));