I beg your pardon. I misunderstood what you meant.
Use:
To make a polite apology about a mistake you made.
Example 2:
Person A: Parents should be sent to the nursery home to relax well and stop making troubles to their children.
Person B: I beg your pardon.
Use:
To show anger / strong disapproval about what someone has said.