WordPress 5.4 – How to prevent to enter only certain values in custom field


WordPress version – 5.4.2

I am creating one WordPress plugin and in this plugin, I need one metadata for the post. I added meta box accesstype visibility successfully. It is a select box and it has only fixed 3 values. it is working fine in block editor as shown below.

enter image description here

However, when I enable custom fields by going in options. it is allowing me to add any value in the text box and it will save it as shown below.

enter image description here

How can I hide accesstype visibility from it or add a select box instead of a text box?