So my project, as per the wife, was to add 2 ceiling fans to the kids rooms. 1 in each. First one went really well but I ran into some trouble with the second. All wire is 14/2 and I didn't draw the grounds in the picture. Yellow is the white neutral wire.
The first picture is what the wiring looked like before in both rooms. There is power feeding the box where the outlet is then a wire that connects to the switch and back to the outlet. That's where I took power for the fan after it comes from the switch. This way the fan goes on and off with the switch.
So on the 2nd room with the same setup, I noticed that gang box was smaller and that putting in another wire would overfill the box. I decided to remove the box and install a deep one. Shouldn't be too hard as the old box was the old work type so it came right out. The problem was installing the new box. One of the wires had the insulation stripped back really short and there was no slack. So when I put that wire in the new box, the insulation was stripped back so it was outside of the box. I wasn't happy with this and I didn't want to re run that wire. Here is what I did.
Behind the outlet was a closet. I cut in a new box inside same studs but higher up and pulled all the wire to there. Then I put in a 1 foot section to feed the existing outlet that now had no wires. Then I connected the fan there.
Now my question. Is this done correctly?
The first picture is what the wiring looked like before in both rooms. There is power feeding the box where the outlet is then a wire that connects to the switch and back to the outlet. That's where I took power for the fan after it comes from the switch. This way the fan goes on and off with the switch.

So on the 2nd room with the same setup, I noticed that gang box was smaller and that putting in another wire would overfill the box. I decided to remove the box and install a deep one. Shouldn't be too hard as the old box was the old work type so it came right out. The problem was installing the new box. One of the wires had the insulation stripped back really short and there was no slack. So when I put that wire in the new box, the insulation was stripped back so it was outside of the box. I wasn't happy with this and I didn't want to re run that wire. Here is what I did.
Behind the outlet was a closet. I cut in a new box inside same studs but higher up and pulled all the wire to there. Then I put in a 1 foot section to feed the existing outlet that now had no wires. Then I connected the fan there.

Now my question. Is this done correctly?