Pressure of carbon dioxide due to two simultaneous equilibriums
It is a conceptual subtlety. It is needed all the species in the hypothetical reaction to require that the equilibrium constant equation be satisfied. This is normally non understood in most chemistry textbooks. The sentence Two equilibria are established is unhappy.

Briefly you can not use this two equations system till you be sure that all the species exist in equilibrium state.

Initially, both solids will react to form the products, once a pressure of 3 atm is reached the only the second reaction will progress. But, as it will increase pressure above of 3 atm the reaction 1 will go in reverse. This situation will continue while CaCO$_3$ is present. Notice that until now there is no requirement that equilibrium constant equation be satisfied due to the states in which the system was were non equilibrium state.
This situation will continue till all BaO disappears. So, the pressure will increase to 5 atm and the first equilibrium won't take place.

Edit: "what happens if CaCO$_3$ is exhausted? then wont CaO react back to reduce the pressure of CO$_2$?"

If CaCO$_3$ is exhausted before reach 5 atm (after that it is not possible), let say at 4 atm, CaO could react back, but as a soon as a it happens (that a little piece of CaCO$_3$ enough big to have the intensive properties of a macroscopic crystal is formed), there will be more tendency to go forward again.

In such case the final pressure will be 4 atm, different from both equilibrium pressure. It will be another equilibrium state. Nothing will change for BaCO$_3$ in this analysis.

Above I exposed two possibilities: The first one, before the edition, that the vessel is small enough to allow the CO$_2$ pressure reach 5 atm. This is the supposed "right answer".
The later where final pressure of CO$_2$ greater than 3 atm and smaller than 5 atm.
If the vessel is very big, it can happen that reactives are exhausted before reach 3 atm, so other equilibrium state will take place.