You said "My ultimate goal is to examine the detailed error message "
The error message will appear in the system log, along with all the other messages from numerous processes on your Mac. You could use the Console app to look at the log, but its filtering is a bit rudimentary.
The only tool you need is the command line tool log. Try man log for starters, then go looking on the Internet for "macOS log predicate example" or something like that. You probably want to look for logs emitted by tccd (the Transparency, Consent and Control daemon) with the text "disable-library-validation" in the message field. You can also cause the problem, then quickly use sudo log collect --last 1m. This will write a .logarchive file into the current directory (it won't overwrite one that is there already), giving you an archive you can poke around in at your leisure. A minute of logs is still a pretty huge database, but it might be a good way to find out what predicate you should be using.
Topic:
Developer Tools & Services
SubTopic:
General
Tags: