Fetching details from the dictionary...
to stray from the right path; to go wrong; to go off the rails; to turn delinquent
中学生の頃にぐれてしまった。
I went astray when I was in junior high.
親の愛情不足でぐれる子もいる。
Some kids go bad due to lack of parental love.
一時ぐれたが今は立ち直っている。
I went wrong for a while, but I've recovered now.