Jenkins - Active Choice DynamicReferenceParameter not returning list
I figured out what was going on. The return from hosts var was a single string with comma separated hostnames host1, host2, I had to convert it to List  using the comma as delimiter. The following post How to convert comma-separated String to List? helped me with that task.
Basically the last section now reads
                script: 
                &quot;&quot;&quot;
                List&lt;String&gt; list = Arrays.asList(hosts.split(&quot;\\\\s*,\\\\s*&quot;));
                return list
                &quot;&quot;&quot;