This weird behaviour arises because you're adopting an erroneous workflow. From the docs:
Currently, the only way to generate a 2D mesh within the editor is by either importing an OBJ file as a mesh, or converting it from a Sprite2D.
Instead of creating a Mesh2D manually, you should first add a Sprite2D to your scene, then convert it to a Mesh2D using the toolbar controls above the editor viewport:
Please refer to the official tutorial to learn more about conversion parameters and intended use cases.