I am not an expert on the FNX, so take what I'm about to say with a grain (or perhaps a pile) of salt:
Judging from what I know about the design of this general type of pistol, plus what I see in the photo, I suspect that the problem was caused by somehow getting the takedown pin BEHIND the barrel lug that it is supposed to control. The slide can't close because the barrel can't ride back and up into battery, and it can't open because the recoil spring and guide are now out of place.
I'd be disinclined to employ the "heavy hammer" solutions proposed (and which work in some other cases). Rather, I'd start by seeing if I could get the takedown pin out of the frame. Usually, these are removed (from this type of pistol; as I said, I'm not an expert on the FNX in particular) by rotating and pulling from the left. This may require some manipulation of the slide to remove pressure on the pin.
If that fails, then I'd check to see if the steel inserts into which the slide rails fit are removable (a la the M&P), and not permanently molded in (a la certain other polymer pistols). If so, I'd remove the pins holding the inserts (there are usually two: the locking insert in the vicinity of the takedown pin and the fire control insert back where the sear is) and see if I could work the slide cum inserts up and out of the frame.
And, of course, if that fails, I'd send the gun back to FN, expecting to have to pay for the repair of what appears to be a plain operator error.