40 Hz Square wave with 8kHz tone

No, it works (in Wokwi).
The micros() is called twice, its value could change between those calls. However, a glitch of 4µs (on a Arduino Uno) is probably not noticeable with the 40Hz.