It wasn't the pH swing, nor was it the CO2 levels. Unless you have 6 or more 2L bottles of standard-mixture DIY CO2 going. And, even in that case, while it might have been a result of too much CO2, it definitely wasn't the result of a pH swing.
As to the original question, installing a valve will most likely cause the tubing to blow off of something.
Look for another cause of the fish death, and your concern for overnight CO2 levels is unwarranted.