From an engineering point of view I would not regard a buried/ adjacent j-box with a THWN-2/THHN tap as being any kind of cure.

The distance is too short for such a conductor to bleed off enough heat -- so as to bring the effective imposed load upon the NM-3 below its 60º C rating.

If buried, that goes double.

======

For peace of mind: the transition needs to be significant, perhaps a run of EMT with THWN-2 in it. Keep the baseboard heater away from the NM-3.

A fire in a basement = total disaster.


Tesla