Took criticism for declaring emergency, quit flying shortly after

For some reference I was a commercial pilot student with approx 200TT when this incident occurred. I was nearing the end of commercial training, instructor estimated I would go for the checkride in about a month.

When the situation happened I was just starting with my night hours, the flight this occurred on was my first solo night flight. I was a little but anxious already because everything felt so new as this was basically my second hour flying at night.

I was practicing the night time touch and goes in a 172 and on the third touch and go I put flaps up, full power and lifted off. As it turns out the flaps didn't go up when I flicked switch and they were stuck at full flap. I was so into the routine of when you flick flap switch up, they just go up, and I didn't turn my head around to visually confirm.

Almost immediately after takeoff I could tell what was wrong, but I had already used up most of the runway from the previous landing and the new take off roll. Also it was so dark outside I wasn't going to take the chance to try and put the plane back down because I couldn't see anything. So I committed to flying the plane.

With the full flaps the plane could barely fly straight and level let alone climb. I had to climb so slowly as to not stall the aircraft. I was really worried about this because I couldn't see anything outside, I knew I was struggling to climb the plane and the airport I am based at is surrounded by mountainous terrain.

Declared the emergency and situation was eventually resolved. Firetrucks followed me back to the ramp and gave them a report.

My reasoning I made in my head for declaring was I was essentially brand new at night flights. I was struggling to climb the plane and couldn't see anything visually yet I knew there was mountains in the area within close proximity of the airport.

During the debrief with my instructor, he basically said I shouldn't have called an emergency and pan pan was enough since I could still fly the plane. Also there was an air canada flight on final who had to abort and do a holding pattern above the city until the emergency was over and he sounded pissed on the radio.

The general attitude from everyone, except from the controller, was declaring a emergency for this was stupid.

It bothered me for so long and I eventually stopped flying a little bit later. It's been about a year now since I last flew but it has recently came up on my mind again and wondering what other people think.

Thanks.