You're essentially using a sandbox toy to perform an earthworks excavation, tone(). It was not designed for, and will not perform such a demanding task.
To gain control of PWM on these MCU's you have to write low level code to control the hardware timers.
Actually, I think that's a really clever idea. And it would probably work OK, if loop (and everything else you add to it, eventually), digitalRead(), and digitalWrite() were infinitely fast.
Unfortunately, those are relatively slow, so this would result in significant time periods where both sides of the H-bridge were on at the same time, which is highly undesirable.
The timers may provide complementary output modes; many newer microcontrollers have at least one time specifically aimed at "motor control" with all sorts of fancy features (complementary outputs, dead times, etc.) But I don't think that any of the Arduino libraries support those features, and I'm not sure whether they're present on the Uno AVR.
Im trying to use this to mess around with resonate frequencies of different piezo buzzers and bigger piezo transducers...
This code is pretty much all I need in the sketch... I may add a POT so can physically change the frequency and have it outputted on the serial so thats all for the code probably
I don't need it to be crazy accurate, once am at a close enough frequency I can always double check the exact frequency with an external oscilloscope
This could be done on an ESP32 ... 1 Hz resolution, 2 complimentary, synchronized square wave outputs (doubles the volume), optional dead time insertion. Could add a toneAC function ... already using an invert function as option for servo control to simplify interface hardware.