Handle region errors where the actual scope is a statement

Prevents a case of "unknown scope, this is a bug".

I judged this too small to review. Closes #4500