When you use the CREATE TABLE syntax to directly save the function results, and if multiple such queries are running concurrently, deadlocks may occur due to the locks on the dictionary tables that get updated with the metadata of the new tables.
In this case, you must use VOLATILE tables rather than permanent tables to avoid dictionary locks. You can view the results in the VOLATILE tables and make a separate CREATE TABLE SQL call to store the results in a permanent table.