Is
{{ mssql_server }} pointing at:
1. your local machine localhost running SQL Server on Linux directly
2. or a remote machine running SQL Server on Linux
3. or a remote machine running SQL Server on Windows?
If your scenario is #2, have you installed pymssql on the target machine as well as your Ansible control node? (See:
https://docs.ansible.com/ansible/latest/collections/community/general/mssql_script_module.html#notes)
You might get more help if you can provide proper output (with passwords redacted) of an actual run with -v[vv], the inventory and as much more information as you possibly can.