Something somewhat similar has happened to me too. I have a good M.Sc. in engineering, but I applied to the mathematics department. I had written my proposal in applied mathematics, and the professor was willing to supervise me. We even had technical discussions by email back and forth, exchanging literature and coming up with ways to pursue the project. But when I sent in my application, it got rejected because priority for the admissions at the department is given to people with M.Sc in maths. So it didn't work out, even with a willing supervisor and good proposal.
Yet, I know people at other universities who have done this. Just down to different admissions policies.