#element_validate expects an array of validation callbacks.
A callback can either be the function name of a globally accessible function, or an array of a class name and method name.
Now I am supposing that '_fix_link_field_value' is the name of a globally available function defined in your module.
So for using it as a validation callback, there is no array required here.
While the first line of your code is adding this callback to the callbacks of #element_validate, the second line is prepending it to an existing callback array, resulting in the following '#element_validate' value:
[[
'_fix_link_field_value',
(class),
(method),
]]
Which won't work. You'd need:
[
'_fix_link_field_value',
[
(class),
(method),
]
]
So what you really want to do is to remove the trailing [0] from your array_unshift call:
if (!empty($form[$field_name]['widget'][0]['uri']['#element_validate']) && is_array($form[$field_name]['widget'][0]['uri']['#element_validate'])) {
array_unshift($form[$field_name]['widget'][0]['uri']['#element_validate'], '_fix_link_field_value');
}
else {
$form[$field_name]['widget'][0]['uri']['#element_validate'] = [
'_fix_link_field_value',
];
}