Where does the constitution restrict the judicial branch from making a ruling in any matter involving either the legislative or executive branch?
A specific restriction isn't necessary, because the judicial is only empowered to do the things which the constitution and the law states the judiciary is empowered to do. The Judicial branch is ONLY able to make their rulings on what is law and Orders enjoining against furthering harm from violating the law or the constitution based on the dispute before them --- the Legislative and Executive branches have their own agency (Independent judgement), and the Judicials are not superior to the Legislative or the Executive branch in their power or authority: Fundamentally the judiciary IS RESTRICTED and cannot order around other branches, And if there is a disagreement --- it's called a constitutional crisis, because they are 3 equal branches of government.
Our constitutional form of government is NOT a hierarchy with the Judiciary branch at the top, and our supreme court is not a "Ruling Committee" who can hand down any order desired to alter or delete any law at will or increase or decrease or change the enforcement of any law in whatsoever manager as the committee desires. The Judicial branch makes orders based on law, and it is up to the elected leaders and bureaucrats in other branches of government to follow lawful orders (or to ignore them, as they have in some cases)
In the same manner that the president cannot order the court to rule X on case Y, or order the court to consider case Z, and the legislature cannot pass a law that the court must never review law Y and the feds can't pass a law that state laws about X be held unconstitutional; the Judiciary has its own independent agency that cannot be taken on by other branches of government -- its rulings on cases.
In exactly the same way the Legislative and Executive branches of government have specific agency in the powers granted them by the constitution --
the judiciary does NOT have the power to override the agency of other branches of government and take actions on their behalf, And the judiciary does not have the power to Order another branch of government to do X with their agency ----- for example, the court cannot order congress to pass law Y, or create tax Z. Although the court CAN invalidate law Y or provide taxpayer relief by declaring debts under tax Z invalid.
The Judicial branch is not empowered to take over any legislative or executive duty and exercise that role on its own.
If the law doesn't say the court can draw their own map, then the court does not have the power to simply draw their own map, and that is true even if the legislature fails or refuses to draw a new map on its own that satisfies the court.