The trick to a long miter joint is flat, straight stock. And a lot of clamps.
Trimwork & Cabinetry
So a guy calls and asks me to trim out a stairway that he and his buddy built.
When bridging an opening in the base cabinets, don't rely on the wall to dictate cabinet placement. Use a straightedge to align the faces of the cabinets on either side.