Isn't that a restrictive understanding of custom functions?
Applying the functional programming paradigm as a hard rule to gage the trustworthiness of custom functions seems, to me, the same as trusting wood joinery only to screws. It offers no guarantee of quality or reliability and is sometime simply inappropriate.
Scripts and functions, custom or not, differ. Unlike scripts, functions: are available everywhere; adopt the scope of the calling code; are limited to calculations, one of which is setting variables.
The ability to set variables when paired with the ability to adopt the caller's scope is valuable. It allows for two capabilities: pseudo-modularity and pseudo-encapsulation (everything seems pseudo in FileMaker).
As an example of the former, I use a custom function to transform a JSON structure into $vars in every script that takes a JSON parameter. I do this in the spirit of DRY, don't repeat yourself. It is impossible to do this with a sub-script.
As an example of the latter, I sometime use custom functions to manage $$vars. I am a believer that $$vars should be accessed in as few places as possible to enhance code maintainability. $$vars sometime need setting in places scripts can't run.
I learned that I could guarantee the existence of errors, not the absence of errors. I trust that all code can produce errors, especially considering the constant changes of dependencies.
Hope this helps.