The newer versions of core create descriptor / HD wallets
See
https://github.com/bitcoin/bitcoin/issues/26239Bitcoin Core is now creating descriptor wallets by default since version 24.0. These have an HD key by default, so Core is blocking you from exporting the private keys made by it.
Docs say you should use
backupwallet with the
-rpcwallet command-line switch (to select the wallet) to make a backup copy of the wallet in a location you choose, which from my point of view is ridiculous since you could just make a copy of the wallet manually.
It is always possible to open up the database wallet file and perform surgery on it to get its encrypted private keys though.
Sadly, it does not allow you to (easily) get the individual private keys

Eliminating all other points of this discussion for the moment. If you are going to keep your coins yourself, which is a very good thing since not your keys, not your coins.
Don't use just core or any other wallet, get a hardware wallet for additional security.
The funds you save will be your own....
-Dave
If I can't get my keys, the point is the same: NOT MY KEYS NOT MY COINS.
So at this point what, if you know, is the last bitcoin core version that allow to EASILY, get your keys like back in the days.