I have made sure to move the modified mac app binary instead of copying it, checked both version's inode numbers (Not the same), and restart my computer as mentioned in https://developer.apple.com/documentation/security/updating_mac_softwar, but the binary still exited with signal 9 and in the crash logs it was a code sign issue:
EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))
So I signed the binary again with my certificate but now this is the error that I get when running the binary:
codesign --force --sign "signature..." binary
*** Terminating app due to uncaught exception 'CKException', reason: 'containerIdentifier can not be nil'
I looked around but I couldn't find any information related to my specific case, any pointers would be appreciated.