This is not so much a bug as it is a known limitation of the code-gen implementation that generates webhook definitions in typescript functions. We will not be investing in adding support for this (at least in the short term), as the implementation would be non-trivial and introduce various complexities into the product.
Palantir Support was correct that you should use your source directly in the function to achieve this functionality.