Looks like as the slide is coming back the bottom of the barrel it is making contact with the shell in the magazine. This is probably causing your dent. As to why, I have no idea. I would suggest you take it to a gun smith.
I was going to say, "It is not possible for the barrel to come back and contact the cartridge there." But it might under a couple circumstances while retraction of the spent case I suppose under some unforseen reasons the upper edge of the chamber could, so look for:
A possibly broken locking block or locking block pin,
maybe the slide lock is installed backwards.
But I would try this first before looking at that. Shoot a round from a fully loaded magazine, yes just one round.
Clear the gun and locate the spent cartridge for the dent. Now, inspect the next (top) live cartridge in the magazine.
Which casing had the dent? The fired one or the next found to be feed?