A Linked Product is a Product in 2 or more Categories ...

If you are not using Linked Products the quick fix is to:

1 Backup your database

2 Make sure you backed up your database

3 Go to Tools ... Store Manager ...

Run the:
Reset ALL Products Master Categories ID
to be used for Linked Products and Pricing:
4 In Tools ... Store Manager ...

Next run the:
Update ALL Products Price Sorter
to be able to sort by displayed prices: Update
This will fix both the missing master_categories_id by assigning the first match in the products_to_categories table and then fix the products_price_sorter for sorting on the Catalog by price ...