MAX712 charging circuit - diode gets too hot
For starters: Electronics can get hot. Very hot, in fact. The diode you are using is rated to 150 degrees Celsius. I would advise you to really avoid getting anywhere near that but what I'm trying to get at is that "I can't touch it with my finger so it must be too hot" is a very bad metric - I would be surprised if you can hold your finger on something that is above 45-50 degrees C for anymore than a few seconds. Hence, it could be that the part is 60-70 degrees (which is just fine). 

Let's run some numbers - keep in mind that I'm using a lot of "rouded" values since this is just a back-of-the-envelope calculation which I wouldn't expect to be accurate within more than 20% anyways:

The Diode 

The diode's datasheet shows that we should expect about 1 volt drop at 1A of current. It also gives us about \$R_{\theta ja} = 20\ K/W\$ (but this is assuming a large lead length. I don't know if you have the part flush on the board or not. Let's assume not - if you do, the thermal performance will be even worse). Given about 1W of dissipation, you need another 20C above the ambient. That's already going to be about 40 degrees, and it's a best-case scenario. If you don't have the 9.5mm lead length mentioned in the datasheet, it's going to get a good amount hotter (I could easily imagine the \$R_{\theta ja}\$ being twice or even three times as large if it's mounted flush to the board with no large copper pads). 

There is also the question of where you got the part - since you mentioned a heatsink from aliexpress, did you also get your parts from aliexpress? If so, there is always a good chance that the diode you recieved is a fake, and is in fact a far less capable diode.

The Transistor

9W is a lot of power, and I very much doubt that that little heatsink you posted in the comments will be able to dissipate that reliably. You already have about \$R_{\theta jc}=3\ K/W\$, so you are looking at a junction temperature of at least 20 degrees above ambient. Even with the heatsink you suggested (5K/W) you are going to get another 45 degrees on top of that, so 65 degrees in total - at a room temperature of 20 degrees Celcius, that's a junction temperature 85 degrees Celcius, and your heatsink sitting at about 65 degrees Celcius!

In other words, it seems reasonable that both get quite hot.