I believe its usually a sign of stress. Possibly water conditions, being harassed ect........ One of mine does that whenever he is over fed, another one whenever he gets physical with my marble cat and another one has never done that......... ever. Go figure ???????/
My guy does it every so often too, but he's alone*, in pretty good condition ... water the water is always at spec. So ... it might just be like a snake and how they shed their skin.
Hoping it's ok - will keep an eye on this topic.
* Usually alone, that is. He's currently babysitting a large Pleco. My 220 gal tank blew out (yes, 220 gal's of water and fish everywhere). Waiting for my replacement tank and my insurance to kick in before posting the story and pix. But
yeah theres no stress as he is the biggest in the tank(28 inches) water is perfect and i feed once a week(fresh fillets) its a mystery to me as he/she has done this since i got it.