user126793: I created a new wallet in Bitcoin Core v23.x,
as expected it created an empty wallet
version 169900
descriptors true
format sqlite.
It seems it created 4 streams of 1000 keys each.
Anyway I told it create some P2PKH, P2SH-nested P2WPKH, P2WPKH, P2TR addresses.
It created a bech32m address, but it won't let me access private keys.
Whatever the address type, it's telling:

error code: -4
error message:
This type of wallet does not support this command

Why is this happening and where to go from here?

user48884: As the error message says, the type of wallet you are using does not support the dumpprivkey command. You are using a descriptor wallet, and individual private keys cannot be exported from the wallet.
You can get the master private keys by using listdescriptors true. This will output all of the descriptors stored in the wallet along with their corresponding private keys. Because Bitcoin Core uses BIP 32 derivation, instead of thousands of individual private keys, you will get descriptors which contain the master private key from which you can do derivation on to get the individual child keys.
Descriptor wallets specifically disabled export of child private keys because it is unsafe. Because unhardened derivation is used by default, a child private key and a parent extended public key is equivalent to having the parent extended private key. However it is not immediately obvious to the vast majority of users that this is unsafe, so child private key export is disabled.

126793: <p>I created a new wallet in Bitcoin Core v23.x,<br />
as expected it created an empty wallet<br />
version 169900<br />
descriptors true<br />
format sqlite.</p>
<p>It seems it created 4 streams of 1000 keys each.</p>
<p>Anyway I told it create some P2PKH, P2SH-nested P2WPKH, P2WPKH, P2TR addresses.</p>
<p>It created a bech32m address, but it won't let me access private keys.</p>
<p>Whatever the address type, it's telling:</p>
<blockquote>
<p>error code: -4<br />
error message:<br />
This type of wallet does not support this command</p>
</blockquote>
<p>Why is this happening and where to go from here?</p>
 48884: <p>As the error message says, the type of wallet you are using does not support the <code>dumpprivkey</code> command. You are using a descriptor wallet, and individual private keys cannot be exported from the wallet.</p>
<p>You can get the master private keys by using <code>listdescriptors true</code>. This will output all of the descriptors stored in the wallet along with their corresponding private keys. Because Bitcoin Core uses BIP 32 derivation, instead of thousands of individual private keys, you will get descriptors which contain the master private key from which you can do derivation on to get the individual child keys.</p>
<p>Descriptor wallets specifically disabled export of child private keys because it is unsafe. Because unhardened derivation is used by default, a child private key and a parent extended public key is equivalent to having the parent extended private key. However it is not immediately obvious to the vast majority of users that this is unsafe, so child private key export is disabled.</p>
