Firearm caused (not ammo related) failure to fire is caused by a blockage of the firing pin, a defective firing pin, or a weak firing pin spring.
In a new firearm, such a blockage can be a deformed firing pin channel liner, a defective firing pin, or contamination in the firing pin channel.
It's also possible that the firing pin safety or the firing pin safety cut on the firing pin is 'out of spec'. If this is the issue, the safety and firing pin safety cut on the firing pin should show excessive wear.
I suggest that you detail strip the slide, disassemble the firing pin assembly, and thoroughly clean all of the parts. Thoroughly clean the firing pin channel with a mild solvent (odorless mineral spirits) and Q-tips.
Inspect the parts for damaged and wear. (Replace any damaged or defective parts.)
To test for firing pin fit and channel obstructions, install the firing pin only (not the assembly, just the firing pin) in the completely stripped slide and slowly move the firing pin lug back and forth from the rear of the slide to its fully forward position. It should move absolutely freely with no 'gritty' feel.
IMPORTANT: When fully forward, the tip of the firing pin should protrude through the breech face about the thickness of a 9mm case rim (0.050").
If all is well, then reassemble and lubricate the slide assembly as per the instructions here...
https://us.glock.com/documents/gun_maintenance.pdf.
Do NOT lubricate the firing pin with 'a drop of oil'. Excessive oil in the firing pin channel 'collects' powder residue and will obstruct the firing pin during operation.
Push the firing pin lug fully to the rear. The spring should be extremely 'stiff'. (Think of trying to lift a 5 lb bag of sugar with just the firing pin lug).
Without depressing the firing pin safety, push the firing pin lug fully forward. The tip of the firing pin should be 'blocked' and stop short of the breech face. Now, depress the firing pin safety and push the lug fully forward. The tip of the firing pin should penetrate the breech face about 0.050" (as described above). Again, the firing pin should move absolutely freely with no 'gritty' feel.
Try the above and let us know what happens. (There are some other issues that can cause pistol induced FTFs, but they are rare. We can address those if the above efforts don't fix the problem.)
Best regards,
Bob