Well, actually, Material Function put out whatever type of data you connect to the output. When I connect a scalar to an output, its a scalar.
If you want the function to return a complete material, you have to use the “MakeMaterialAttributes” node within the function and wire that to an output.