Edit: Used wrong resistor at R_BAT1. The schematic was correct, the part I used was wrong.
I am using the following charging circuit. It is the standard circuit taken from the datasheets. But it is not working.
The line on the right leads to an LD3985M33R LDO and then to a microcontroller. All the other components are working fine, if I bypass the DW01A by shorting the battery ground and common ground - the TP4056 charged both my 18650 batteries fine and stopped charging once it was done, the switching circuit with AO34021A works fine, the LDO regulates perfectly and the microcontroller works fine as well. If I remove the short, the battery gets disconnected.
I bought a blue TP4056 module that has the same circuit (I traced the leads with a multimeter) and it works fine without bypassing DW01A. I took the DW01A and the C_PROT1 capacitor from that board and used it in my board. My board still does not work. I placed the DW01A and C_PROT1 from my board on the purchased TP4056 module and the module works fine.
I am stumped and unable to figure this one out. I am probably missing something obvious. Could you please help me? Thanks in advance.