You are correct. Looks like I learn to scribe. How do you get both stiles plumb and (appearing to be) the same width?
First is the wall just out of plumb or is there a curve to it? That's the reason for the template...if it's curved. If not, and the wall is straight, but out of plumb, then ditch the template idea!
Plumb the wall with a 48" level first, see if it's out and how far and where top or bottom. Check in the corner and at the depth of the new cabinet. Plumb the existing cabinet side ,,,same as above. Record the offsets on a piece of paper larger than your new cabinet using the straight edge of the paper as a reference, you could use a piece of ply also. Layout your cabinet dimensions within the plumb lines. This will be your minimum carcass width minus an 1/8th or less to allow for installation. After you scribe and fit the wall template, establish a plumb line on the template using the "back" side of the level while holding the template firmly against the wall, you might need 3 hands for this...or if the existing cabinet is plumb measure over the same distance top and bottom and mark your template with these reference marks. A 24" framing square will do the same thing off the existing cabinet. Just add the dimesion to the 24 over to the wall, assuming your new cabinet is greater in width than 24". This is all to establish a maximum size rectangle that will slide into the opening being bound on both sides by the wall and the existing cabinet. Whew! That becomes the dimensions of your new cabinet carcass.If you use a rabbet corner and a rabbet back panel and a dado shelf or two this will all be much easier with "square" corners and right angles rather than trapezoids. You could, I suppose, build the new cabinet, piece by piece in place as you go, but that wouldn't be my choice. Cut and fit, cut and fit, etc. or in this case fit and cut!
At some point you will have to chose whether to build the face frame piece by piece and assemble on the "hung" carcass or build it as an assembly and then attach it to the carcass.
Well, that's about all I can offer for now, bill