Does it look like this from the side, with a triangular scape/dent?
My G27 was doing the same thing. It's sort of an extractor issue. Some people have replaced the extractor and it fixed the problem, but for other people only the new 28926 ejector would fix the problem. In my case a new extractor didn't make any difference, I had to install the 28926 ejector and that finally fixed the problem.
The 28926 ejector isn't available to the public yet, if you're a Glock Certified Armorer you can order one, or you can ask an Armorer in your area to order one for you and install it for you. The ejector comes by itself, so you have to remove the trigger housing, pull the old 1882 ejector out, and insert the new 28926 ejector into it.
Remove the trigger housing from the frame, grab the ejector with a pair of pliers and pull it out of the trigger housing, then insert the new ejector. Be careful not to bend the ejector to either side because the slightest change can either adversely affect ejection or put the tip of the ejector closer to the primer of a live round being ejected which would be dangerous.
(I wrap the teeth of the pliers in masking tape so the ejector doesn't get gouged or scratched)
Pretty soon the new ejectors will be available to the public in the latest Gen4 trigger housings, the new Gen4 trigger housings have part numbers 30275 for 9mm and 28927 for .40. Once the retailers change their manufacturer part numbers for those parts to those numbers, it's a simple matter to order one, remove the ejector, and insert it into a Gen3 trigger housing to use in your Gen3.
Here are pictures of the new ejectors:
If your G27 doesn't have the bigger magazine catch like your Gen4 G17 has, that means your G27 is a Gen3. Gen3's and Gen4's use different trigger housings, so if you were to order a 28927 Gen4 trigger housing, you'd have to remove the ejector from the Gen4 trigger housing and put it into the Gen3 trigger housing for your gun.