Here are the 10khz waves of Class-D both done by Stereophile tests, one with and one without the Stereophiles special AUX-0025 passive low-pass low power filter. This filter can't be used while listening as it would burn out almost instantly.
With the special bench test filter:
https://www.stereophile.com/images/916BC600fig2.jpg
Without the special bench test filter:
https://www.stereophile.com/images/1212AM1fig02.jpg
Now I ask ANY linear amp manufacturer, would they be happy if their amp gave a 10khz square wave that looked like the second pic to sell to the public.
Cheers George