In a descriptor wallet it returns “This type of wallet does not support this command” instead of the private key. Even though the wallet doesn’t store the key directly it obviously knows how to build it since it can spend the funds so it should do that and return it. There are just too many cases where a private key needs to be dumped and it shouldn’t be a nightmare of RPC calls and 3rd party scripts to try to get it, that just doesn’t make sense usability-wise.
Just a common case point for us for example, we still use p2sh-segwit for our users since too many places still don’t support bech32 and pretty regularly people still send LTC to our BTC addresses (smh, I know) and we need to easily be able to dump the key to recover it for them.