Reaction of acyl chlorides with diazomethane and silver(I) oxide $$\ce{R-COOH -&gt;[SOCl2,CH2N2][Ag2O/CH3OH] X}$$

While solving Carboxylic derivatives recently, I came across this.
so following the reagents one by one-
$\ce{SOCl2}$ will form acid chloride.
$\ce{CH2N2}$ (diazomethane) on the other hand reacts with carboxylic acid to give a methyl ester. but we are currently on acid chloride, this part is a little confusing to me.
$\ce{Ag2O}$ in aqueous/alcoholic medium should give ($\ce{CH3O-}$) ions.
How to proceed? What is wrong with my reaction mechanism?
Your first reaction is correct. You do get an acid chloride. The reaction would proceed with the first step being what you have proposed:
$$\ce{R-COOH -&gt;[SOCl2] R-COCl}$$
Now, the next step is a reaction known as Arndt-Eistert Reaction:
$$\ce{R-COCl -&gt;[CH2N2][Ag2O/CH3OH] R-CH2-COOCH3}$$
The mechanism for this reaction is as follows:


Note: Mechanism is from Organic-Chemistry.org