Detached Robot Piece During Match

Is it illegal to detach a piece of your robot during a match with another mechanism on the robot?

Yes, it is illegal. The game rules explicitly mention this

Robots may not intentionally detach parts during any Match, or leave mechanisms on the field. If an intentionally detached component or mechanism affects game play, the team shall be Disqualified at the refereeā€™s discretion. Multiple intentional infractions may result in Disqualification for the entire event.