I have herd of people putting them in a completely dark cage for 24 hours to kinda naturally “ castrate” them, but that would mean he might not be able to reproduce,
24 hours of darkness might lower a cockerel's hormone level for a little while, or it might not, but I'm sure it would not permanently "castrate" him. If there is any effect from the darkness, it would be temporary, not permanent.