Suppose you have two independent standard normal variables X1 and X2. You later impose a single constraint g(X1,X2) = X1 + X2 = 0. Since X1 and X2 are still standard normal and you haven't talked about any transformation of them, the constraint may or may not be satisfied for any particular realization of (X1,X2). In fact, the constraint will not be satisfied with probability 1.
So how is the distribution of w1*X1^2 + w2*X2^2 calculated? Is conditional on the zero probability event that the constraint is satisfied? Hmm, that doesn't sound right.
I've seen constraints imposed in statistical procedures where the chi^2 statistic is modified, e.g., ordinary least squares subject to constraints on the coefficients. But the constraints are not applied as you describe.
Please give a specific, concrete example of a statistical procedure that does what you describe.