Melee coming out too slow?

I don’t know if this is related to lag or not but there seems to be something I notice when meleeing. Usually my gunfights leads to both me and my enemy having to melee to get the kill. The thing is, I feel like I melee at the same exact time my enemy does, yet the game only shows that my enemy punched me and my melee was too slow or something because it didn’t even come out