It is a penalty but it is a ridiculous punishment for what happened. Not sure what the answer is but I don't think penalties are fit for purpose when a handball on the line results in the same outcome (obviously minus the red) as pushing someone on the edge of the box when they are heading...