In some cases,
The categories entity
had an empty request_path
.
Go to the database and with the help of this command find the categories or products
entities that have an empty request_path
SELECT * FROM `url_rewrite` WHERE request_path='';
Delete all those entries and use the cache clean and flush command:
php bin/magento cache:clean
php bin/magento cache:flush
Revisit the url
, and the homepage will work fine once again.