例えば、つわりでつらい時に一緒にいたらイライラして八つ当たりをしてしまう可能性があった時などです。
~でよかったね=It's good that...
一緒にいなくてよかったね=you were not with...
主語が「私と」であれば、
It's good that you were not with me
主語が「彼と/彼女と」であれば、
It's good that you were not with him/her
主語が「彼らと」であれば、
It's good that you were not with them
あの時=at that time
是非参考にしてみてください。
この場合、次のような言い方ができますよ。
ーI'm glad we weren't together then. I probably would have taken out my frustrations on you.
「その時一緒にいなくてよかった。イライラを八つ当たりしていたかもしれない」
to take out on someone で「人に八つ当たりする」
ご参考まで!