I may have gotten folding wrong. The question is whether the subquery gets run once at execution time and folded in, or whether it gets run on every row. I will have to double check the specific behavior but it's a query folding issue not a plan vs execution time issue.
As I think about it I may have gotten it wrong. It might need to be in a subquery to fold in that way.
I suspect that you're mixing up stable and immutable. (Only immutable functions are evaluated at planning time.)