Hi, I think you need to separate them into 2 meta boxes. In this situation, the logic is applied to only 1 CPT. It's better to separate them.
You can put fields
into a parameter to save your code, like this:
$fields = array(); // Your fields for both meta boxes here
$meta_boxes[] = array(
'id' => 'first-id',
'post_types' => 'page',
'show' => array(),
'fields' => $fields,
);
$meta_boxes[] = array(
'id' => 'another-id',
'post_types' => 'solution',
'fields' => $fields,
);