Hi,
I did something similar. I find more simple.
View attachment 173516
When SW1 is pressed: it activates Q2 to power ON the MCU
R1, C1 are for delayed switching OFF power (maybe 100ms ... 1s) like R1= 1MOhm, C1 = 1uF
At power up the MCU sets Pin (2) HIGH to ensure power stays ON
at MCU Pin (1) your firmware is free to detect button press and react on it.
To switch OFF power just set Pin (2) = LOW
There is room for improvements. ;-)
I recommend to use the MCU internal watchdog to ensure proper power up after power down
Klaus
P.S.: no need to use exact parts for Q, D, R, C