The "intuitive" solution works in both cases, you just have to adjust where the probability mass of the revealed door/compartment goes. I.e., you always start with equal probability mass on all three doors/all five compartments (with "it's not there" as fifth compartment); when you open one and see a goat/no adapter the probability for that door/compartment goes to 0 and then have to be careful about where that probability mass goes to instead.
In Compartment/Monty Hall with random door, the probability distributes across all other doors/compartments equally, so Monty Hall (1/3, 1/3, 1/3) becomes (0, 1/2, 1/2) and Compartment (1/5,1/5,1/5,1/5,1/5) becomes (0, 1/4, 1/4, 1/4, 1/4) and then (0, 0, 1/3, 1/3, 1/3) and finally (0, 0, 0, 1/2, 1/2).
In Monty Hall with Goat, all probability mass flows to the third door and (1/3, 1/3, 1/3) becomes (0, 1/3, 2/3)