That's quite ineffective. You have to leave the fire block present for at least one tick (and dependent on level tick rate) to make sure that the player bounding box has indeed intersected with the fire block to initialize the damage