What causes gas oven to click but doesn't always ignite?
The clicking sound is the spark module trying to ignite the gas. You should be able to verify that it is actually sparking. Since the oven does light intermittently check to see if the openings in the burner are blocked.
With a toothpick probe each opening for obstructions. If it continues working erratically it could be gas pressure regulator.