I’m pretty sure that’s how it works
It's not though. Here's Law 6: "Assistant referees and touch judges are responsible for signalling touch, touch in-goal and the success or otherwise of kicks at goal. In addition, assistant referees provide assistance as the referee directs, including the reporting of foul play." And:
6.13 The referee may consult with assistant referees about matters relating to their duties, the law relating to foul play and timekeeping, and may request assistance related to other aspects of the referee’s duties.
6.14 The referee may alter a decision after a touch judge or an assistant referee has raised the flag to signal touch, touch-in-goal or an assistant referee has signalled foul play.
So, there's
nothing in the Laws that empowers a touch judge to overrule a referee. The touch judge may only intervene if there's foul play, touch or touch in goal. Otherwise, the referee may choose to consult a touch judge and may choose to change a decision based on what he's told. But a touch judge can't just run on and say, "no, that wasn't a penalty", any more than a spectator can.