Cannot re-create mirror of a github repo after internal gitlab error

My colleague accidentally deleted two projects under our org. Both projects were setup as mirrors of public github repositories, used for CI/CD purposes:

Not a big deal, we can always re-create the mirrors. Except unfortunately, the deletion failed with an internal gitlab error, leaving the projects in some kind of broken state. One of the projects still has the repository under it, while the other one is now an empty project without a repo. I am unable to fully delete either project (the “Delete Project” button does not do anything).

Most importantly, I cannot create fresh mirrors of the original github repos: when I do “New Project” → “Run CI/CD for external repository” → “GitHub”, the two github repos in question appear with import status “Failed”, so I cannot connect them to a new project.

The original gitlab error when deleting the projects was: This project was scheduled for deletion, but failed with the following message: PG::QueryCanceled: ERROR: canceling statement due to statement timeout CONTEXT: SQL statement "DELETE FROM ONLY "public"."ci_build_trace_sections" WHERE $1 OPERATOR(pg_catalog.=) "project_id"".

I’d appreciate any tips on how to resolve this.