I recently deleted an unused account. I had an SX which had a split assigned to this account in its template. (I never actually fired the SX) Upon deleting the account, a warning appeared telling me of the problem with the SX and opened the template editor so I could fix it. I deleted the offending split which had no account assigned to it. Upon trying to exit the template editor with the [OK] button, I get an error "Invalid Account in Split - split with memo 'foo' has an invalid account." and all I get is a [Close] button. I can't exit the SX template editor and am stuck in a loop. I've tried re-entering the memo text and assigning a valid account, but GC still throws the same error. I managed to exit the editor by clicking [Cancel] instead. This left the SX unchanged from its original state. (with the still offending split not assigned to an account) I then edited the SX to first assign the split to a valid account and saving it. Then I edited it again by deleting the split. While I was able to recover and find a workflow that accomplished the task, I'd think GC shouldn't have been stuck in the loop in the first place. I unfortunately did not think to test deleting the offending split outright the second time I intentionally entered the editor via the Actions menu so I don't know if there is a different code path there that would not cause the loop. If it is of any use, the SX in question was not marked as 'enabled'.
I can reproduce the problem. You need a split with 3 accounts (at least), when removing the offending one, GC complains. Removing the entire transaction works well though. I'll look into it.
Jean's fix was added to maint and will be in the next release 3.11
I didn't get to test 3.11, but I can confirm this is fixed in 3.906.