ios_facts doesn't return output when used in playbook but shows output in ad-hoc command. Why?

Below is my playbook to gather ios_facts info in GNS3 router. The output shows “VARIABLE IS NOT DEFINED!”

But when i gather ios_facts using ad-hoc command, it works. Why the difference?

The facts are gathered and prefixed with 'ansible_net_' (like
ansible_net_all_ipv4_addresses).
You should not use register.