Trouble with MeshDrawer2d

The problem is associated with the MeshDrawer2D. Keep the MeshDrawer2D out of any function i.e. in the global scope and it will work fine.