Note adding the let _ = 0. This could be any valid line of code, however, it doesn't matter. The error then is:
Cannot convert return expression of type '[NSLayoutConstraint]' to return type 'NSLayoutConstraint?'
So the question is, why would inserting a line of code before the return cause the compiler to expect Optional<NSLayoutConstraint>, whereas the original accepted [NSLayoutConstraint]?
If a closure contains a single expression, Swift will consider its body in addition to its signature and the surrounding context when performing type inference. [...] If a closure body is not a single expression, it will not be considered when inferring the closure type.
From this, we already know that block closure is of type (Element) -> [Result] from the xx definition. We then know that Element == UIView from [self] portion and that [Result] == [NSLayoutConstraint] from the function return type. So the compiler can indeed infer that xx.block is of type (UIView) -> [NSLayoutConstraint] without ever looking into the closure body (which it won't).
The problem with flatMap is that there are two ambiguous definitions the deprecated one returning optional, and the new one, so the compiler is left with two different function types in the end before requiring to look into the closure body.
It could still be a bug, though, since normally the error would be more useful:
Unable to infer complex return type; add explicit type to disambiguate