I guess you had a "professional" do it this way, and you're thinking since a professional did it, it must be right. Afraid not.
As others have said, Code requires outlets be mounted INSIDE listed junction boxes that is rated to safely contain the kinds of electrical problems that happen inside junction boxes. The box must come flush to the wall... with one exception, if the closely surrounding material is known to be fireproof (e.g. drywall, concrete or stone), the box can be up to 1/4" (6mm) short of the wall.
Not 2 inches lol.
How I'd attack it.
As manassehkatz says, you will need to enlarge the hole. To keep the enlarging to an absolute minimum, I would use a 2-pronged attack:
Use the smallest box available, a metal "Handy-Box". These are available as extender boxes that can stack off the box you have... although if you want extenders of arbitrary thickness, that may be tricky to obtain. Don't waste time at big-box stores, talk to a proper electrical supply house.
Move the GFCI so it isn't here. Because GFCIs can't fit inside Handy-Boxes. (it is extremely difficult at best!) This requires you grasp a huge concept about GFCI protection: GFCI is not a receptacle! It is a zone of protection. A GFCI in one location can provide GFCI protection to outlets elsewhere. So wherever the power to this outlet comes from, put the GFCI there. If it's a breaker, that's fine, they make GFCI breakers.