Remove unreachable error branch by casting to UInt in parsing (#58480)
The `ncodeunits` field of substrings - and therefore also their size,
cannot be negative.
Ideally we would also remove the unnecessary checks in the other
`tryparse` methods, that take start and end indices, but that should
probably be rewritten to take a view, but that's a PR for another day.