Unable to delete inactive Discourse theme

Hi. We are having problems deleting an inactive theme via the UI in our Staging environment (located in /admin/customize/themes). After clicking the “delete” button, nothing happens. Tried doing the same in our Dev environment, but the theme gets deleted right away. There’s no difference in the structure of their app.yml file (same plugins as well). We need to delete this theme for testing purposes.

We already checked the database and confirmed that the theme is no longer there. Even tried rebuilding Discourse but it didn’t help.

SELECT * FROM themes;

It seems that the “deleted” theme is stuck. We tried editing the settings of the “deleted” theme, and we got this error:

It looks like it is deleted in the DB but even after rebuilding, it is still showing up somehow.

Just to add, /logs is showing this warning but we checked the assets folder and it can be found there: