This looks like an over-zealous assertion, without any user-visible consequences. Mea culpa.
Attached patch corrects the problem. I also noticed in passing that there is another obsolete comment -- formIterIsContainer() is former jsonbIteratorNext() infrastructure, which the updated comment now refers to directly.