I don't think it's broken, just sometimes doesn't work like it should.
It has to do with tick rate mostly, as well as player ping and the compensation system. Of course, the model's hitboxes also matter, but they're quite big and almost cover more than they should (because of how some heads are...