I know that this question has been asked frequently but I don't know where my argument went wrong. This is Monty Hall Variant, where the initial setting is exactly the same, except Monty forgot which door contained the prize, so he had to randomly choose one door among the remaining two other doors, and it turns out the door he chose contains a goat. (If he happens to choose the door that contains the prize, then you lose)
For example, WLOG you have initially picked the door A. Then Monty randomly chooses one door either from B or C, but let's say C for the sake of argument. Then the prize is either behind A or B. Then let's define some notations:
Let A,B, and C be events that door A contains the prize, door B contains the prize, and door C contains the prize respectively. Also let Mc be the event that Monty chooses the door C.
Then I want to compare P(A|Mc) and P(B|Mc).
Then all there is left with is using bayes' rule to solve both probabilities, and in order to solve it, I need to find P(Mc|A), P(Mc|B), P(Mc|C), but I argued that they are all 1/2 because no matter where the prize is hidden, he has to choose the door B or C with equal probability, namely 1/2, so conditioning on where the prize is hidden won't affect Monty's decision to choose the door among B or C, except he can't choose A since it has been already chosen by you. (I think this is where I screwed up, but I can't find what went wrong).
Then I find P(Mc) which turns out to be 1/2, and then I compute P(A|Mc) and P(B|Mc), which is 1/3 for both of them. The only part I got it right is that there is no advantage gained by switching doors, but from what I have googled, the probability that the prize is behind in either of these doors must be 1/2. What went wrong? Any input appreciated.
You're forgetting $P(C\mid M_C)$ which is also $1/3$.
If you want to model the situation that Monty randomly opens door $C$ and that is not where the prize is, you need to state that directly in the condition. The probabilities then jump to $$ P(A\mid M_C\land\neg C) = \tfrac12 \qquad\qquad P(B\mid M_C\land\neg C) = \tfrac12 $$
As you note, this doesn't affect $P(M_C)$, but since $P(M_C\land \neg C)$ is smaller than $P(M_C)$ (as it is perfectly possible that Monty opens door C and discovers a door), the corresponding conditional probabilities can still differ.
Computing $P(B\mid M_C)=P(C\mid M_B)=1/3$ correctly tells you that your chances of winning this entire game is $1/3$ if your strategy is "choose door A first, and then if you don't immediately lose, switch doors".