error code: -4
error message:
This type of wallet does not support this command
Bitcoin Core v23.2
I suppose it is because a specific wallet has to be created in bitcoin core, but I don't know how.
You're answering on a 3 year old topic i'm afraid... Nowadays, bitcoin core creates descriptor wallets by default. You can't import private keys into these wallets.
I haven't run bitcoin core in a while, but if i remember correctly, the wizard to create a new wallet in the gui allows you to create a non descriptor wallet (this is also possible from the cli). If you create such a wallet, you *should* be able to import your private keys. You should probably add a "false" at the end of your command to skip the rescan if you want to add multiple private keys, then manually start a rescan after you're done importing.
Do be carefull tough, there's a reason why by default core creates descriptor wallets nowadays. Make regular backups of your wallet to be safe!