I'm surprised it is hard to find an entry of
に in the dictionary that can fit the usage.
But finally I found this which is under the entry of
(In the form of
だろうに) Saying some supposition that is different from the facts
If (you) try a little harder, you should have (succeeded).
It seems that we can even treat
だろうに as a whole phrase.
I didn't find a source which give an origin of this usage. However, I don't think it is related to the case particle, nor that it is form from elision.
For the final use of the のに, it does come from the the conjunction use(source).
(from 準体助詞「の」＋接続助詞「に」) Used after 連体形. To link two contradict statement, with a feeling of unexpectedness or unsatisfactory.
「東京は晴れなのに大阪は雨だ」Although it is sunny in Tokyo, it is raining in Osaka.
「九月だというのに真夏の暑さだ」Although it is September, it is as hot as in summer.
(From 1 when used at the end of sentence) Used after 連体形. Showing feeling of dissatisfaction, disapproval, bitterness, accusation.
「これで幸せになれると思ったのに」(I) thought (I) could be happy after this.
I think this use of のに can be treated as the latter half of the sentence elided.
NOTE: The translation of explanations and examples are made by myself.