It looks like the autostop script is not getting triggered. Can you check the cloudwatch logs and see what's being printed? The echo statements should ideally indicate whether the conda env got deactivated, autostop script was fetched, and whether it was triggered or not. Refer to the lifecycle configuration to see these statements. Based on what you see in the cloudwatch logs, it would be clear till what step the script was getting triggered. My guess is that the notebook part is probably throwing some error and so the lifecycle script was getting interrupted.
The logs might give you better idea.