subpanel location - proximity to in-wall heater and other junctions
You're fine, as long as you don't cook the subpanel that is

The clearance rules for electrical equipment (NEC 110.26(A)) start at the front of the electrical equipment and extend out from there, as they're intended to provide the electrician with enough space to work on it without having to perform a contortionist act.  This means that having the subpanel share a stud bay with other stuff is fine.

You do have to make sure that the in-wall heater doesn't raise the subpanel above about 40&deg;C though, otherwise the ampacity of the breakers needs to be derated to prevent false tripping due to excessive heat.  If the heater is trying to overheat the subpanel, sticking a rockwool batt into the stud bay between the heater and the subpanel should solve the problem and obviate the need for breaker derating.