Nothing wrong with it, as long as that ceiling junction box is accessible after finish (blank cover?).

It may be the case that it is easier to fish wires from the walls into the ceiling space than to drill the studs and fish wire along the walls from box to box.