Thank you. I was able to fix the signing, and build the sample. I deployed it following the instructions at Monitoring System Events with Endpoint Security.
It is still not working!
2022-06-24 10:03:41.336276-0700 0x2afd13a Error 0x0 10092 0 taskgated-helper: (ConfigurationProfiles) [com.apple.ManagedClient:ProvisioningProfiles] Disallowing: com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension
2022-06-24 10:03:41.336858-0700 0x2afd136 Default 0x0 58495 0 amfid: /Library/SystemExtensions/29740531-05AF-45A5-86BA-B90086AD3947/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension.systemextension/Contents/MacOS/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension signature not valid: -67671
2022-06-24 10:03:41.336976-0700 0x2afd31d Default 0x0 0 0 kernel: mac_vnode_check_signature: /Library/SystemExtensions/29740531-05AF-45A5-86BA-B90086AD3947/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension.systemextension/Contents/MacOS/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension: code signature validation failed fatally: When validating /Library/SystemExtensions/29740531-05AF-45A5-86BA-B90086AD3947/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension.systemextension/Contents/MacOS/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension:
2022-06-24 10:03:41.337005-0700 0x2afd31d Default 0x0 0 0 kernel: proc 10165: load code signature error 4 for file "com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension"
2022-06-24 10:03:41.337947-0700 0x2afd31e Default 0x0 0 0 kernel: com.example.apple-samplecode.Sam[10165] Corpse allowed 1 of 5
2022-06-24 10:03:43.610407-0700 0x2afd13d Default 0x0 74723 0 ReportCrash: Formulating fatal 309 report for corpse[10165] com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extensi
2022-06-24 10:03:43.612784-0700 0x2afd13d Default 0x0 74723 0 ReportCrash: Unable to find store record for 'file:///Library/SystemExtensions/29740531-05AF-45A5-86BA-B90086AD3947/com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension.systemextension/': Error Domain=NSOSStatusErrorDomain Code=-10811 "kLSNotAnApplicationErr: Item needs to be an application, but is not" UserInfo={_LSLine=175, _LSFunction=_LSFindBundleWithInfo_NoIOFiltered}
2022-06-24 10:03:43.628775-0700 0x2afd13d Default 0x0 74723 0 ReportCrash: com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension is not a MetricKit client
2022-06-24 10:03:43.629125-0700 0x2afd13d Default 0x0 74723 0 ReportCrash: (CoreAnalytics) [com.apple.CoreAnalytics.stability-event:event-send] Sending event: com.apple.stability.crash {"bundleID":"com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension","bundleVersion":"1","exceptionCodes":"0x0000000000000000, 0x0000000000000000(\n 0,\n 0\n)EXC_CRASHSIGKILL (Code Signature Invalid)","incidentID":"81CBD9E8-3A8D-4A7A-88CF-628648696D26","logwritten":0,"process":"com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extensi","terminationReasonExceptionCode":"0x1","terminationReasonNamespace":"CODESIGNING"}
2022-06-24 10:03:43.630773-0700 0x2afd1fc Default 0x0 221 0 analyticsd: [com.apple.CoreAnalytics.stability-event:event-recv] Received event: com.apple.stability.crash {"bundleID":"com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extension","bundleVersion":"1","exceptionCodes":"0x0000000000000000, 0x0000000000000000(\n 0,\n 0\n)EXC_CRASHSIGKILL (Code Signature Invalid)","incidentID":"81CBD9E8-3A8D-4A7A-88CF-628648696D26","logwritten":0,"process":"com.example.apple-samplecode.SampleEndpointAppAMLU8UA7F6.Extensi","terminationReasonExceptionCode":"0x1","terminationReasonNamespace":"CODESIGNING"}
2022-06-24 10:03:43.631178-0700 0x2afd1fc Default 0x0 221 0 analyticsd: [com.apple.CoreAnalytics.stability-event:event-aggregated] Aggregated. Transform: StabilityC