Is it within code to complete 12g wiring circuit with 10g wire?
Yes, you can use larger wire.  However if you are putting in a junction box it must remain accessible.  That means you cannot cover it with drywall or hide it behind anything.