Agreed - and that’s true in this case too - I only spotted it because it was screwing up my monitoring. A lambda that appeared to be succeeding was still showing as an error!
As it is, the root issue turned out to be an hidden asynchronicity in elasticsearch which highlighted an unhandled exception path in my code. So the first invocation failed, but the second worked.
As Trent (and the documentation) points out - there’s an automatic retry when the lambda is invoked by an event - so whilst it looked like voodoo, it was actually doing the right thing!