It probably went like this. Referee doesn’t see the ball hit the defender’s hand. Assistant is aware that the referee is unsighted and draws his attention to the potential handball by flagging for a foul and then puts his flag across his chest to indicate a penalty. Referee blows his whistle and points to the spot but not having seen the incident goes across for a discussion. Referee has the final word.
Remember that the linesman only has a flag but the referee has the whistle.