TLDR: can a light switch box be used as a j-box to extend a lead for a different circuitry?
I am removing a long section of a wall (shown with blue outline) and I need to rehouse some of the wiring of a circuit. Right now I have a single lead coming from breaker box, through floor joists, into a 2-gang box (B) with light switches. Switch #1 powers under-the-cabinet lights, and switch #2 powers a kitchen fan. The same box also acts as a j-box for kitchen can light circuitry (actual switches for those are located elsewhere), and a range hood.
I am removing the under-the-cabinet lights, as well as the hood circuit, so I only need to power and switch the fan, and power the can light circuit. I will have a single switch (C) on the remaining section of that wall, but the lead is not long enough to reach it. The path from the breaker box for new wiring is a very difficult one so I'd rather not fish a new wire. But the existing lead can easily reach the 4-gang box (A) in a nearby wall/post.
Is it okay to use box A as a j-box to splice another run of 14/2 wire through ceiling joists to box C?