This should not happen in general, so if you face this again and can share a minimal example that triggers the error, that will help a lot.
There was a bug fixed today that is very likely to be the same you encountered, but please let us know if that happens again.