Standard RC filter compared to inverting cancellation filter and sallen-key with same resistors and capacitors. 1MHz switching.
Left side is a modified version of https://www.edn.com/cancel-pwm-dac-ripple-with-analog-subtraction/
Can use buffer and inverting buffer to eliminate delay in the inverted side.
Right side is a sallen-key filter
https://www.electronics-tutorials.ws/filter/sallen-key-filter.html
Bottom is simple RC filter