Heatsink rise of 40C is based on what power loss?
Absolute max. is 125 deg C for the junction and I expect heatsink to junction resistance to be 1.5 ~ 2 deg C/W above heatsink.
You could limit Tj to 100deg C max or a Tj rise of 70 deg C.
, based on your power dissipation.
70C rise{Tj}max=40C rise {Tsink} + Watts*2deg/W {Rj-c-hs}
Solving above, if your power exceeds (correction) 15 Watts , Fix you heat sink or better yet , get a better MOSFET with 10x lower RdsOn like 85 mOhm instead of 0.85 Ohm .
Pulsing a PV array to charge a battery is not ideal efficiency for a PV, but more efficient for the switch to dump 6A across low voltage than high in linear mode with less current. Using a steel core choke such as a Microwave oven transformer in series with switch (protected with diode) will give you continuous voltage loading on PV where 75% of no load voltage is close to ideal power transfer to battery, then modulate Duty cycle of pulse or PWM to adjust charge to battery limited by optimal CC limit, CV limit and float voltage limit. Now you have a "real" solar panel battery charger using SMPS switching of MOSFET, optimal PV power loading, optimal battery charging and optimal power transfer to load at minimum temperature rise to MOSFET!!!
A junction temp of 100'C is marginal for short life, not ideal. Tj<85DegC at worst case ambient is a commercial std. Stick to best practises please. Every 10degC rise above 25'C for Tjcn results in 50 % less life (Arhennius law)