Hi,
First, yes you should be able to fail your pipeline if back-end processing fail. The docs should help. Note that if Background processing fails, your Quality Gate status will come back as Error, so there are actually 3 states for this ‘boolean’.
Regarding the core of your question, I wouldn’t want to directly manipulate the database; more than likely it will result in some future upgrade migration failing.
Could you describe how you end up with >400 char project ids?
Ann