I was also running into this same problem recently.
I was surprised to see it was creating a new cert but then failed to be able to use it again after.
In my case it fails even on the first attempt, not just the first run.
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
Tags: