Just got a response to my own problem and it might work for you too. It is:
In the project properties change "physics engine" to "box2d web"
Just tested my game and it did not crash like it used to. Very similar problem like yours and the error looked very same too.
My problem had to do with sine (size). Example here:
edit2. Funny how similar your bugtest was to my example. I hadn´t seen this when I made mine.
But the problem persists. The physics engine change didn´t remove the error. I wonder if chipmunk physics would.
I guess the sine with size/height is causing this.