The documentation for the creation of custom fields here:
https://metabox.io/docs/create-field-type/
Indicates that you should use the admin_init hook, this causes issues on the front end, using the init hooked fixed it, but I don't know if this is the proper fix.
I'm using 4.8.1