My apologies, I didn't notice that packagesbuild was a third-party tool, I took over the project from a different developer, so I'm not a 100% familiar with the tooling yet.
I had a look at the link you sent and managed to get it working by running the productbuild command on the .pkg file generated by packagesbuild.
productbuild --sign "Developer ID Installer: [...]" \
--package "com.optimidoc.cloudclientsigned.pkg" \
"com.optimidoc.cloudclient.distribution.pkg"
I suspect that the problem was in the fact that packagesbuild generates a "component package" (similar to pkgbuild) rather than a "product archive" like productbuild does, but I haven't done any testing to verify it.
Thank you for pointing me in the right direction.