As you mentioned you are not able to overwrite the data of the lead record into the existing opportunity record.
As per the article Considerations for Converting Leads
When updating existing accounts or contacts during lead conversion, the values of mapped lead fields don’t overwrite the values of the mapped account and contact fields.
This is also applicable for Opportunity objects during lead conversion.
Although we may use custom code to convert leads into existing accounts and contacts, the value is not replaced when the lead is converted.
String leadId = '00XXXXXXXX';
Database.LeadConvert lc = new database.LeadConvert();
lc.setLeadId(leadId);
lc.setAccountId('001XXXXXXXX');
lc.setOpportunityId('006XXXXXXXX');
lc.setConvertedStatus('Closed - Converted');
Database.LeadConvertResult lcr = Database.convertLead(lc);
convert lead using apex code
The system automatically maps standard lead fields to the standard account, contact, and opportunity fields.
For custom lead fields, your administrator can specify how they map to custom account, contact, and opportunity fields using Map Lead Field