[stackView constraints]
is probably returning an empty array -- which is incorrect and causing the problem.
If that's the case, then nothing is triggering an initial pass of updating constraints or layout when the stack view is in the window.
Adding your own constraints in the window would be enough to trigger it, but NSStackView should be able to trigger it itself if it wasn't otherwise (this is probably worth filing a radar over).
One way to work around this, without adding unneeded constraints, is to call:
[window updateConstraintsIfNeeded];
or
[window layoutIfNeeded];
after the StackView has been added to the window.
Update: This is fixed in NSStackView in Yosemite, 10.10.