Re: Clean URL for 5.1.9?
Do you see any records in xc_clean_urls? Perhaps these link to removed entities, and this causes the issue.
If this is the problem I think removing everything from the database table should fix it. However, I'm not sure 100%, so please create a full backup before altering anything in the database