Restored command error behavior when called from command line

Refs #19973.