setting self.isBodyActive = false in collision detection function crashes

I am trying to deactivate a physics body when it reaches a certain position. I have created a static sensor (a rectangle) at the desired location. When the moving physics object collides with the sensor I am disabling further movement by means of self.isBodyActive = true in the collision detection function.

I have a number of dynamically created physics objects and a corresponding number of sensors. I am trying to stop objects moving once they are each in place. This sometimes works but is prone to crashing in the simulator with the following error message in the terminal …

Assertion failed: (0 <= proxyId && proxyId < m_nodeCapacity), function GetFatAABB, file …/…/external/Box2D_v2.1.2/Box2D/Box2D/Collision/b2DynamicTree.h, line 141.
/Applications/Corona Game Edition 2010.109/Corona Terminal: line 9: 1809 Abort trap “$path/Corona Simulator.app/Contents/MacOS/Corona Simulator” $*
[import]uid: 2646 topic_id: 3764 reply_id: 303764[/import]