When converting an existing field to an encrypted field, two things to keep in mind:
1)make sure the field length of the existing field matches the max length of the encrypted field type.
2)if there is data in the existing field, it cannot be encrypted in Jakarta version. But it can be encrypted from the Kingston version onwards.
When converting an existing field to Encrypted text field, if the max length doesn't match the length of the encrypted field type, the value of the encrypted field will be empty in List as well as the form even for the Users with the Encryption context roles.
For example, when the string of 40 max length is converted to the Encrypted field, encrypted value will not able to fit in. So the data will not be shown.
If the max length of the encrypted field is updated to match the length of the encrypted field type, the encrypted field data in the newly created records will be displayed without any issue.
But still, the existing data will not be shown. Because Encrypted Field Configurations is not supported in Jakarta version. If the data exists in the field that you want to encrypt, the user should open the encrypted field configuration(System Security > Field Encryption > Encrypted Field Configurations) record and select Run mass encryption to encrypt existing values. So there is no provision for encrypting the existing data.
Refer the product documentation for more information.