Unfortunately the solution you propose won’t work. It violates state separation of powers in state constitutions. Legislators cannot interfere with how judges write or reason their decisions.
Thank you for that insight. I don't know how many state constitutions have such provisions, but since state judges undoubtedly swear to protect and defend state constitutions as well as the federal Constitution, state constitutions need to be amended to accommodate such laws to hold judges accountable to their oaths.
After all, the states have never amended the federal Constitution to expressly protect so-called gay rights like gay marriage as the judge mentioned in this thread has wrongly asserted.