As @claire replied in this thread
After surrounding macro name with run_query block like this
run_query
{% macro create_udfs() %} ... {% do run_query(fn_metadata_header()) %} ... {% endmacro %}
The macro is successfully executed.