I missed out on a job in the UK, because of immigration status. HR intervened in the search committees deliberations, in order to select the other guy. The problem was, they didn't decide that all the other candidates were unqualified for the position, so HR said they had to go for one with an EU passport. The search committee chair tried to assert that because I had an EU spouse, they could hire me anyways, but HR disagreed. I don't know if it would have been any different with a UK spouse - you still need a work permit, but HR's level of knowledge about that issue might be higher.
If someone from HR tried to do that for a hire where I was on the committee, I would raise holy hell.