EVP_get_cipherbyname("des-ecb") does not fail when legacy provider is not loaded. It will fail later at EVP_CipherInit. This is surprising. EVP_get_cipherbyname is no longer reliable to get a cipher. It seems we have to completely change to EVP_CIPHER_fetch. EVP_get_cipherbyname should fail at this case, otherwise it should be deprecated.
Tested on Fedora Rawhide(36) with openssl-3.0.0-1.fc36.x86_64.