Pitching forward is a common problem, mostly from not keeping your chest up high enough.
Lifters, on a max lift, tend to bend forward at or near the bottom as your body tries to avoid dealing with the heavy load. That keeps your hips up, so proper depth is harder to reach, and as you bend forward, the bar will move forward a touch, so that you will feel the weight shift from heel/mid foot to your toes.
You are then stuck with using your lower back to get the weight moving up again as your legs are no longer taking the full weight.
It's all mental discipline. Force yourself to keep your chest up. Some lifters do that by looking up, but that cause other issues if done excessively.
It also helps if you have decent squat shoes. Squishy shitty "runners" are never a good squatting option. Something with a firm sole is best. A bit of a raised heel helps for raw squats. Flat soles for wide stance squats, which is what you would use if you were using a squat suit (which you prolly aren't so skip that).
No problem using ammonia in the gym. And your point about not trying something new at a comp is spot on. Never do that. Ever. Train like you compete. Compete like you train.
But as I said, it's overkill to use it on every heavy set. Keep it for max efforts. You will get far better progress by fixing your form than snorting ammonia.
Keep at it. Its better to be dead than average.
Vid below of Jezza squatting in training. Notice how he keeps his chest up. Makes it look easy.
Compare that to this phaggoty bad squat form. Notice that at the bottom of the squat (at least he kinda gets down there) the barbell is well forward of his knees and toes as he bends forward.