OKOK I found the true real problem this time:
When i was creating my select element i was initialising it with 1 option. When i did that the moodle form understood that the select element will never have more than 1 option. So when i submited the form and the option value was 2, the select didn't work because the value shouldn't be more than 1. So i have to create a select element with enough option so it can fit.
Hope that helps someone one day