It's a Cap and a Tool
You have been using your Leica M with screw mount lenses via the Leitz screw to bayonet adapters IRZOO (50mm), ISBOO (90mm), or ISOOZ (135mm). Somehow you have jammed the adapter to the camera and are having difficulty removing it.
Do not reach for your hand tools! No pliers, screwdrivers, or prybars! Leitz produced a tool for removing stuck adapters. It is the M rear lens cap.
Tiny tabs at the rear of the cap fit into the cutouts on the adapter. Position the tabs into the cutouts and twist to free the adapter. Simple and effective. The illustrations show cap and adapter variations.