What worked for me was adding the --entitlements argument into codesign command:
codesign -vvv --options=runtime --entitlements <path_to_your_entitlements> --force --timestamp --deep [...]
Topic:
Code Signing
SubTopic:
General
Tags: