Well the only explanations i could think of for the treatment she received are:
1) the duke treated her coldly so that servants and all other related or unrelated people could see that he doesn't care about her and not let her become more exposed to danger than she already is because of the duke himself and all the people who hold grudges against him or want to exploit/destroy him (though I'm not sure how that worked out because the crown prince already seemed to know that she's his weakness and so did the emperor too I believe?)
2) he sent her to the shadow room so that she would be safe there as it said that once someone went in, there's no going out again, of course the crown prince seems immune to the rules because of his personality and status and so he could've rescued her and clearly didn't expect her to literally kill herself because of the overwhelming sense of betreyal and sense of loss all meaning to life