For anyone who has the same problem in the future, I found the issue. Turns out it had nothing to do with my invocation code, but rather a quirk with lambda's built in testing suite sending old test cases, as opposed to old inputs being used. Testing outside of lambda doesn't run into this issue, so not actually an issue at all. Still spent a good few hours on it, of course!