After a lot of trial and error, I finally found a way to make it work. Here is what I did.
As noted before, rather than trying to run an installer from a share, I simply copied it on to the local disc of the VM.
Before running Ansible on windows, the operating system has to be configured using (for example) the ConfigureRemotingForAnsible.ps1 script. I took the defaults. I didn’t bother setting up any of the advanced options like CredSSP, as in practice there didn’t seem to be any benefit.