The use of the trailing closure isn't the main issue here, the compiler can actually parse it (though it'll emit a warning asking you to enclose in parens), it looks like the issue is with:
case .failure():
You need to either write a pattern to match against the error associated value, or write case .failure: instead. With the latest 5.9 snapshot you'll get a marginally better error message (in that it will actually point to the problematic bit of code):
error: type '()' cannot conform to 'Error' [type_cannot_conform]
case .failure():
^