In case the range is not square? Huh? Don't hire the person that said this! Ranges come in standard sizes, and as you see, your 30" range is NOT 30". The standard is to set the space between the base cabinets is 30"
Long and boring, but the proper way...
You will have to see how the cabinet is fastened. If it is screwed on the sides to the "walls" of the housing then you need to remove it before removing the "walls"
If the cabinet is screwed on the back- to the actual wall (even id it has side screws) then empty it out completely and you should be able to safely detach the wooden "wall" you want to move.
In this case you will need pad out the extra space in-between the cupboard and wooden wall you are moving with another piece of wood that will fit. You need 3" inches.
A nice way would be to pad both sides of the cabinet with 2" thick pieces of wood to give you an extra 4". Painting it white will make it look like it should be there.
Then you need to screw from inside the right side of the cabinet through the padded wood into the wood of the existing cupboard -- but not so the screw comes out the other side. You need to measure precisely the length. screw in each corner and centre. Then put the left wall back in and screw from the left side inside the cupboard the same again.
You obviously have a problem with the light switch. IF you got enough space inside you could make a square opening in the side "wall" that you are moving and put the switch in there. The wires will be behind the fridge any way - just insulate them with some flex plastic pipe for wires.
The light switch will have to get moved to something similar like this. You can mount it flush /countersink it into the wall you are moving. The biggest problem is cutting out the hole to the correct size. You can go larger but you cant shrink. So be careful and try to fit it several times.
![enter image description here](https://i.stack.imgur.com/JcYEH.jpg)
It is not an easy undertaking- but I would not do it any other way.
If you cant be bothered ...
If you cant be bothered doing it the right way. Then put several wall bolts in the back of the cupboard in the corners and centres. Then remove the left "wall" and put your fridge in.
But this will NOT work if you have a drywall behind the fridge.
![enter image description here](https://i.stack.imgur.com/KoAXu.jpg)
Best Answer
If the gap bothers you that much, you have a few options.
Fill the gap
You could fill the gap with wood putty, or color matched caulk. You'll still have a gap, but it will be difficult to see.
Remove material from the molding
You could remove a bit of the material from the back of the molding, to allow it to lay flat over the lip of the cabinet. This will likely make the mitered joint between the two pieces of molding look odd, as the bottom of the pieces will not mate.
Remove material from the cabinet
You could remove a bit of the material from the cabinet, to allow the molding to lay flush with the side of the cabinet. Depending on how far out the cabinet overhangs, this might also look a bit strange.
Learn to live with it
The easiest approach, is to simply learn to ignore it. Not many folks will notice it, and after some time you probably won't either.