For a variety of reasons, gratia doesn't handle models well when there are transformations of covariates applied inside s() etc in the model formula, e.g., y ~ s(log(x)).
In part, this is because Simon wipes out the references to the environment of the formula to avoid huge fitted model objects because the environment of the formula can contain copies of the data. However, not having this information makes it a bit more difficult to reconstruct the original data used to fit the model - Simon only stores the model frame, which will have a column for log(x) but not x itself.
I should be able to try to evaluate the formula / call in the calling / or global environment, and gracefully handle things if finding the data fails. I should be able to make this work reliably in practice for users, but inside testthat tests it might be a little more complicated.
Anyway; let's get this fixed once and for all.