I had a similar situation few months ago however my D light was used to blink occasionally earlier to this incidence.
Since I have changed my tranny I can shed some light if you have to go for transmission change.
There are 2 type of transmission available qabli. One is jdm which has some minor issues coupling with our ecu. Not that it doesn't work, it works fine but it's not perfect match. Somehow I am using that same one. This costs 20-25k
Second option is some Malaysian or Indonesian or Turkish variant tranny that actually suits our ecu works perfectly but costs 30-40k.plus you will have to research a lot on how to confirm its the right transmission.
The shopkeepers will keep telling you that the difference doesn't matter or there is no difference at all. That's all like, if you know, they give you D17 engine for replacing D16W9 (PKDM VTi engine) that has a single stage vtec to couple with our dual stage vtec ecu and say there is no difference at all. That engine runs fine but never perfect on our setup
So value the difference and find the right tranny if you want to keep the car