Error while modifying custom reports via branding repository. How to fix?

When you create a custom report, change its category via the branding repository and then attempt to view the original report that you created (before modifying the category), you will encounter an error.

Run the following query to update the report:
In the above query category_name is the ID from the report_category table, which you can get by running the following query:
Ensure that the report type in the report belongs to the new category using the report_type_meta_data table by running the following query: