Field weight ignored on buildForm() I need to set the  $form['langcode']['#weight'] to -251.

I tried also to access the widget weight. But the position weight still remains on bottom of the form.

Why is that? I tried:

//form field sort ('#weight')
$form['langcode']['#weight'] = "-251";
$form['langcode']['widget']['#weight'] = "-251";
$form['langcode']['widget'][0]['#weight'] = "-251";
$form['langcode']['widget'][0]['value']['#weight'] = "-251";
$form['langcode']['#weight'] = -251;
$form['langcode']['widget']['#weight'] = -251;
$form['langcode']['widget'][0]['#weight'] = -251;
$form['langcode']['widget'][0]['value']['#weight'] = -251;


Also on the hook_form_alter I cannot change the weight.
Sometimes these arrays will have a #sorted key that needs to be set to FALSE for the array to be sorted (again) and your weight changes to have an effect. Here it would be at $form['#sorted'].