Fixed #21284 -- Prevented KeyError swallowing in fetch_command

Thanks wildfire for the report.