Enemies to lovers thrives on friction, but court romance gives that friction an audience. Characters may be forced to cooperate while disagreeing about loyalty, status or the best way to survive palace politics. Every conversation can carry a second meaning.
The most enjoyable rivalries have a real source. Perhaps the characters have conflicting goals, incompatible methods or reasons to distrust one another. Their arguments should reveal what each person values rather than rely on insults alone.
Court settings make the shift towards affection especially entertaining. A character may have to maintain a public image while privately reconsidering everything they thought they knew. A small act of kindness can feel enormous when it comes from someone they expected to dislike.
Banter helps, but it cannot do all the work. The relationship needs moments of honesty, respect and changed behaviour. Readers should be able to see why the characters become important to each other.
In Assigned to the Ruined Prince, Yi Yinxiang expects to make his new watcher miserable, while Gu Yanzhi expects a difficult assignment. Their mutual irritation is the starting point, not the whole relationship.