I was Glock Certified, I think it's expired.
This is problaby something with the extractor. Make sure there isnt any shit stuck under the claw where it's supposed to be grabbing the base of the brass to drag it out of the barrel. Also make sure it has the correct amount of movement. Using a snapcap will let you take a peeksie-poo at it when you cycle it slow to see if its grabbing without risk of ND's, etc.
Then take a look at the good old fashioned ejector. Is that bad larry looking good? Is it bent wrong or damaged?
Are you limp wristing this animal or are you holding it like Thor? A true mans man grip?
I own a G42, I don't think it's ever done anything bad in terms of malfunctions.
I did discover that a 100% dry G17L will work like a bitch and give you tons of failure to eject if you don't lube her up like the sly lady she is. All of my other Glocks I've owned (G23, 26,27,30,33,34,42) don't really care what you put on them.
I can take it apart for you fully and put it back together and look at it for free if you want.