Error adding multiselect filters to segments with the API

Your software
My Mautic version is: 4.4.10
My PHP version is: 7.4.33
My Database type and version is: MySQL 5.7.44

Your problem
I’d like to use the Mautic API to create segments with filters using a multiselect custom field.
The filters part, as an example, would be like this:
$filters = array(
‘glue’ => ‘and’,
‘field’ => ‘my-custom-field’,
‘object’ => ‘lead’,
‘type’ => ‘multiselect’,
‘operator’ => ‘in’,
‘properties’ => array(
‘filter’ => array
0 => 123,
But when I try to create the segment, the API refuses to do so and returns a error 400: “filter: This value is not valid”.
I created a segment using the interface with exactly the same filter without error. Then I tried getting the details from the API and found that the filter part is exactly equal to the one I’d like to create using the API, so I don’t understand.

Then I’ve tried a workaround, 1) create the segment without the filter part, 2) add the filter array serialized directly to the lead_lists table on the database. That worked and the contacts are added as expected BUT when I try to edit the segment filters in the Mautic interface, the value of the multiselect field is empty!

So, is there something wrong I am doing or maybe is a bug of the application?

Thank you.

Anyone have any ideas about this? I appreciate anyone’s advice.