Especially when unions are involved. We have a flexible schema for many parameters (e.g., X accepts an object or an array of them, and one object has some properties that could be an enum or a detailed shape), and both Zod and Valibot produce incomprehensible and useless error messages that don’t explain what’s wrong. We had to roll our own.
Have you tried applying boolean algebra conversions on the schema? Some ORs can be written as NOT AND expressions. I don't know about these JS versions, but in my lib the choice of boolean expression had influence on th3 error output.