The authors of the encoding/json library thought the same. As a way to exit from deep down in a parse stack it works well especially if you only have limited entry points.
https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/en...
uses well typed panics.