[verb (ば-form)] + [past result] + のに [verb (ば-form)] + よかったのに [verb (ば-form)] + いいのに [i-adj 〜い → 〜ければ] + [past result] + のに [na-adj] / [noun] + であれば + [past result] + のに
ば~のに says what would have happened, or what you wish were true, when it isn't: "if only…", "if…, I would have…". The first half is a ば-form, the second half says what would follow, and のに at the end adds regret or frustration that things went the other way.
The ば-form never changes; the past goes on the second half. It is the past ending there that makes the sentence about something that did not happen.
With よかった, the sentence is "should have…". Said to someone else it is a reproach – why didn't you? – so don't say it to a superior.
About yourself, ばよかった on its own is the usual regret. Adding のに makes it sound like a complaint about how things turned out.