I am unfamiliar with how BetterDisplay works, but, the DCP block of the M1 M2 SoC does not necessarily have to be outputting to a physical display with the specified resolution. The contents of a screen with a certain resolution can be dumped into the frame buffer regardless, and its size is limited by how much data the block permits. It is possible that the pixel count is only one set of perimeter where you can reduce something else, like color depth, to reach the same data cap while increasing resolution.
There should be no harm in doing these sorts of tricks, but on the system / software level you are subject to abnormality whenever an OS update or security patch comes, and then some times app incompatibility.