There are Youtube videos that address your question with the p365 showing that if the hook shears, the striker's velocity is reduced such that the striker has insufficient momentum to discharge the round. Here is how this is prevented in the p320, (which is done differently). I couldn’t again quickly find p365 video, however there is a Youtube video explaining the secondary design in the p365 striker assembly preventing discharge if the striker hook fails.
Found the video on the p365 striker safeties:
Found the video on the p365 striker safeties: