The scholars differ on what to do in this circumstance.
Some of them say that it is obligatory to obey the parents in this matter just like it is obligatory to obey them in anything else which is permissible. And they cite specific support in the ahadith:
عن ابن عمر، قال كانت تحتي امرأة أحبها وكان أبي يكرهها فأمرني أبي أن أطلقها فأبيت فذكرت ذلك للنبي صلى الله عليه وسلم فقال يا عبد الله بن عمر طلق امرأتك
Ibn Umar narrated:
"I had a wife whom I loved, but my father disliked her, so he ordered me to divorce her but I refused. I mentioned that to the Prophet ﷺ and he said: 'O Abdullah bin Umar! Divorce your wife.'"
— Jami at-Tirmidhi
قال فإذا جاء زوجك فاقرئي عليه السلام، وقولي له يغير عتبة بابه. فلما جاء إسماعيل، كأنه آنس شيئا، فقال هل جاءكم من أحد قالت نعم، جاءنا شيخ كذا وكذا، فسألنا عنك فأخبرته، وسألني كيف عيشنا فأخبرته أنا في جهد وشدة. قال فهل أوصاك بشىء قالت نعم، أمرني أن أقرأ عليك السلام، ويقول غير عتبة بابك. قال ذاك أبي وقد أمرني أن أفارقك الحقي بأهلك. فطلقها، وتزوج منهم أخرى
Abraham (عليه السلام) said, 'When your husband returns, convey my salutation to him and tell him to change the threshold of the gate (of his house).' ...
[later] Ishmael (عليه السلام) said, 'Did he advise you anything?' She replied, 'Yes, he told me to convey his salutation to you and to tell you to change the threshold of your gate.'
Ishmael (عليه السلام) said, 'It was my father, and he has ordered me to divorce you.
Go back to your family.' So, Ishmael (عليه السلام) divorced her and married another woman.
And when this applies to the father then it applies a fortiori to the
قال رجل يا رسول الله من أحق بحسن الصحبة قال أمك ثم أمك ثم أمك ثم أبوك
A person said: Allah's Messenger, who amongst the people is most deserving of my good treatment?
He said: Your mother, again your mother, again your mother, then your father
Others have however disagreed and said that in these ahadith the parents had a valid reason to command divorce, which is presence of bad qualities in the wife. And that obedience to parents in this regard only applies when there is a valid reason similar to the above. Or if the parent is like Abraham (عليه السلام) or Umar; i.e. righteous, knowledgeable, clinging to the truth and justice, and free from following personal whims - which implies that they will have a valid reason. Otherwise a person does not have to obey the parents in this matter. And they have stated that the husband should first consult a reliable scholar who will investigate and can make an unbiased judgement on whether the wife should be divorced. Fatwa is usually given on this second opinion.
Ref: Mawsoo’ah al-Fiqhiyyah, https://www.islamweb.net/ar/fatwa/70223/ , https://islamqa.info/en/answers/47040/