In case your error happens because of adding too much 2d meshes to a MeshBatch:
Always check with Starling method canAddMesh before adding mesh via addMesh to a meshBatch, that solved the problem for me. If meshBatch is full, canAddMesh should return false and that indicates that you need to create a new meshBatch or clean up an old one.
If canAddMesh returns false, then the error will happen on your next addMesh.
I believe it was possible to cleanup meshBatch of unused meshes, but I do not have access to my old code to lookup exactly how I did that.
Also that might indicate that you use MeshBatches in too many cases, they are intended to be used only for elements that are drawn in a big quantity at the same time.