Destroying a layer (for example for closing a dynamic dialog) is not handled by the 3DObject addon and leads to errors and broken state.
3dObjectDestroyLayer.zip
Low priority as it can be worked around by making sure to destroy all 3DObjects before removing the layer.