(Ame, non-linguist) I agree with you that you ought to have known better suits most situations well.
I thought that you would have known better: something unexpected happened and the speaker is expressing surprise mixed with a mild reproach.
Considering that you and your companion fight in armor, I thought that you would have known better. - Plato (Euthydemus)
You ought to know better/I thought that you would know better: The event (to my understanding) is still unresolved or there is present danger. For example, a person is trying to pry apart pieces of frozen meat while holding them in his hand.
Stop that! You ought to know better than to do that! (I thought you would know better...)
Or, the person stabs himself (I actually saw this). The other person stares at the fork imbedded in the hand, tines out the other side, and exclaims, You ought to know better than to use a fork that way! while desperately wrapping the bleeding hand-cum-fork. In the Emergency Room, the patient says sheepishly, I really (ought to/should) have known better, to the registrar, the nurse, the doctor, the radiology tech...