You can take a look at this tool created by a fellow community member which can give you some ideas how to catch such errors timely.
It’s also an option to work on the prompt but there will still be an error rate regardless. So I suppose checking the replies for correctness before delivering them to the user is the more robust approach.