The code isn't throwing errors as it doesn't know if dpkg supports this option and therefore it is a perfectly fine case to get a non-zero exit here. At the time the code was written there was simple no way of detecting it, now there is dpkg --assert-multi-arch but that isn't supported by all dpkg's which support --print-foreign-architectures, so we just don't bother to try for now as it introduces more problems than it solves.
The code isn't throwing errors as it doesn't know if dpkg supports this option and therefore it is a perfectly fine case to get a non-zero exit here. At the time the code was written there was simple no way of detecting it, now there is dpkg --assert-multi-arch but that isn't supported by all dpkg's which support --print- foreign- architectures, so we just don't bother to try for now as it introduces more problems than it solves.