Hi Vivian Glen
Even though you have Contributor role, it could be failing due to the permission needed for creating the network components like VNET, Network Security Group, public IP etc. You could add the 'Network Contributor role', if you want to create the network items when creating the VM. Try creating the VM after adding the role and see if it works!
Hope this helps.
--please don't forget to upvote
and Accept as answer
if the reply is helpful--