selectattr()
filters a list by testing whether it meets the criterion (either a test name like 'defined'
or if no test is provided it checks for truthiness.) It does not change the individual list entries in any way, so in this case it will probably still be the exact same list.
You want something more like this:
loop: "{{ server.results | map(attribute='virtualmachines') | flatten }}"