Simplify and correct nasty case in coercion opt
I happened to be in this area of the source code anyway, and so fixed this little bug.
I'm not particularly expecting anyone to review this in depth, but you're welcome to have a go.
Fixes #21062 (closed).