This is lying to the planner, and you get to enjoy whatever breaks because of it. A function that accesses external data is not immutable; it is stable at best.
I understand that, but it's not documented, so users can think that way is fine. So, it would be good to explain why this way could break this or that.