Hi @slitweb
You code looks OK for me. Could you please share the URL where the code is used, the JSON export file of your field group and the complete template code? Please keep in mind that the forum attachment feature doesn’t allow you to upload a PHP file. Kindly zip it first or use https://gist.github.com/ instead.
Thanks 🙂