When people say "piece" of mind instead of the correct, peace of mind. Why would someone want a piece of your mind?
Both are correct - it depends on what you mean, contextually.
give someone a piece of your mind
1. to speak angrily to someone about something they have done wrong: 2. to…dictionary.cambridge.org
Edit: Apologies if you specifically meant someone just using "piece of mind"... Just realised that.
Yes, if I could give you a piece of my mind, I would have peace of mind. But I certainly wouldn't give you a piece of mind like a piece of pie. Lol.