Steps to Reproduce:
1. Open a Field Group with existing fields.
2. Select a field with a type different from 'group'.
3. Change the field type to 'group'.
Current Behavior:
Changing the field type to 'group' triggers a JavaScript error and crashes the UI.
This issue occurs when changing the type for both newly added and unsaved, as well as previously saved fields.
Expected Behavior:
Changing the field type to 'group' should proceed smoothly, similar to changing to other field types.
Details:
MetaBox v5.9.5
Meta Box Builder v4.6.7