Bitcoin Core deprecates encrypting an existing wallet with the encryptwallet RPC
Bitcoin Core merged pull request 36387 on 20 November, deprecating the encryptwallet RPC for wallets that were created without encryption. The release note added with the change says the call will be removed in a future major release. Until then it works only if bitcoind is started with the -deprecatedrpc=encryptwallet option; without it, the call returns a deprecation error telling the user to set that flag. The note states that creating a new wallet with encryption enabled is not going away or changing.
The pull request gives three reasons why encrypting a wallet after the fact is risky for users and developers. No effort is made to remove remnants of the unencrypted key material from disk, which the author describes as difficult and dangerous to attempt and, on some SSDs, infeasible. Encrypting a wallet with manually imported descriptors changes the wallet's spending conditions without the user expecting it, a problem tracked in issue 26607. And because new keys are generated after encryption, restoring from a backup made before encryption can lead to a loss of funds.
Most of the change is in the test suite, which used encryptwallet to set up encrypted wallets. Those tests now create wallets with a passphrase from the start, and the deprecation test checks that the call fails without the flag. The user guide in doc/managing-wallets.md was updated to match.

Why it matters
Encrypting a wallet that already holds keys can leave the old keys readable on disk, which a user cannot see. Steering users to create encrypted wallets from the beginning removes that gap; anyone with scripts that call encryptwallet will need the flag once this reaches a release.