Click/Typer CliRunner.Result.stderr is a property that raises ValueError when stderr was not separately captured (mix_stderr=True is the default). Wrap all result.stderr accesses in try/except to handle this gracefully.