31-40k I am in Dilemma! Should I upgrade my Present PC to AMD AM4 or AM5 or Intel LGA 1700 chipsets? Budget is limited to 40k

May be try something different this time , Buy zen4 mini pc with ddr5 ram and minisforum deg1. Zen4 based mini pcs , you can easily import for around 42k from alibaba.
 
Maybe but I saw similar error queries in AMD, MS & Reddit forums for solutions and they all were saying that older gen processors are getting problems coupled with same gen motherboards. My PC crash is related to Azure server cannot get authentication because of AMDfTPM for some older motherboards and if so called users use stand alone TPM then then the problem is solved.
My other crash is due to the motherboard C States. I disabled it and somehow one problem got solved. Normally it comes enabled by default.

One AMD forum moderator was saying that as AM4 processors age they tend to cause problems like in the case of one user who has 3800X with X570 motherboard he has same problem like me with Azure server and while he changed his processor the problem went away. So AM4 CPU with compatible motherboards were causing problems for some after certain period of usage not when they were new.

PS: I underclocked my processor but my A520M does not have more options like curve optimiser as such. So now crashes have gone down but not much. If I change my motherboard now it will cost 10k then want to have 32GB RAM so adding this means another 4k.
When I 1st thought of changing all three parts like CPU,Mobo, RAM to 5700x3d, B550M wifi Mobo, 32GB RAM all are amounting to around to 37k same amount as any new AM5 Combo. So that's why I asked about what to buy.
This TPM fiasco was such a mess and for many still is but isn't "Azure server" related to Microsoft Azure service which has nothing to do with TPM? Also if I remember correctly AMD Chipset driver had some driver related to AMDfTPM which might have helped (or caused problem if not installed fresh).

Processors don't really "age" per se but as it was one of the AMD forum moderator who said this they might be talking about limited support for the motherboard chipset as it aged with less and less bug fixes being committed further in its life span. Whatever it was you are now looking to upgrade your PC so I shall leave it at that and forget about it.

One strong argument for upgrading to higher end motherboard chipset is definitely the curve optimiser so I see your point. Used to be the overclock-ability but processors these days come tightly clocked with ability to overclock on the fly so the benefit potential is gone. You should definitely go for newer gen if the cost is coming out to be same. If I recall correctly Ryzen 7600 is about same as 5700X3D is terms of performance and with DDR5 prices coming down to affordable range yeah that's the right call.