The umpire's warning was an appropriate way of handling an oddity in the rule about follow through interference.
If the bat hits the catcher after the batter has swung at a pitch and hinders action at home plate or the catcher's attempt to play on a runner, it's followthrough interference, and the umpire starts calling people out and sending runners back.
However, if there's no action to hinder--say on a foul ball or a swing with less than two strikes and no runners on base--the same followthrough is not interference and incurs no penalty.
That doesn't mean it's okay to conk the catcher in the head with a bat.
Warning the batter is a reasonable response to avoid repeating an unsafe situation.