No, that's on purpose. Using a SQL function with a body would not trigger the problem with the stats loaded at the end of the SQL test as we would skip the fatal call of statext_expressions_load(). Based on your confusion, I guess that a note to document that is in order, at least, so as nobody comes with the idea of changing the definition of this function..