fdo#75628: SUM should inherit error if one is present in its references.

Change-Id: I94017fe91295dbb929f57be5e3fb26edf5032a8f
(cherry picked from commit d658c092f488fc0d4cb924fe3e34cab997db76e2)
Reviewed-on: https://gerrit.libreoffice.org/8504
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>