While editing a group in the UCP, the settings for the group_legend do not exist. Therefore, the user will never submit the group_legend attribute with the form. However, the group_create function expects the group_legend to have a value though. An empty value tells the group_create() function that the group has been removed from the legend which is of course incorrect for the UCP as it can't be removed there.
The includes/ucp/ucp_groups.php file should automatically pass the group_legend to group_create when submitting the form.