"come unglued mentally" sounds more wide-ranging and drastic. "feel panic" refers to a specific emotion. It is possible, though, that severe or pathological panic could be associated with someone coming "unglued mentally".
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.