I'm not sure that the proposed patch is correct. The errors should be ignored during postrm purge, but this change also affects the results if "postrm remove" fails; since the linux-ubuntu-modules postrm will be called with the "remove" argument while linux-image is still present (unless someone has overridden dpkg with --force-depends), any failures in postrm remove are probably an issue that it's better to raise an error on.
I also don't think that update-initramfs needs to be called at all for "purge"; this should all be handled already for "remove".
I'm not sure that the proposed patch is correct. The errors should be ignored during postrm purge, but this change also affects the results if "postrm remove" fails; since the linux-ubuntu- modules postrm will be called with the "remove" argument while linux-image is still present (unless someone has overridden dpkg with --force-depends), any failures in postrm remove are probably an issue that it's better to raise an error on.
I also don't think that update-initramfs needs to be called at all for "purge"; this should all be handled already for "remove".
So here is a counter-suggestion.