It happens that in ActiveRecord when does the decrypt it passes another key_provider, which is the deterministic key, so using this it works:
ActiveRecord::Encryption::Encryptor.new.decrypt(cipher, key_provider: ActiveRecord::Encryption::DeterministicKeyProvider.new(ActiveRecord::Encryption.config.deterministic_key))