Ceci dit, il ne faut surtout pas en savoir trop non plus, sous peine de finir comme les sénateurs.
= "That said, you must not stick your nose too deep in there, either. Or else, you’ll wind up like the senators."
I assume that « X, sous peine de Y » means "failing X, you run the risk of Y". But I’m not completely sure how to use this expression.
Perhaps, « X, quitte à Y » is an expression that lies at the other end of the spectrum, with the meaning of "do X, even at the risk of Y".
Il faut en savoir plus sur cette affaire, quitte à finir comme les sénateurs.
= "We need to dig deeper into this matter, even if it means following the same fate as the senators."
Overall, with « sous peine de », the focus is on trying to avoid the risk mentioned, whereas « quitte à » is more about being willing to take the risk. Am I correct in my assumption?