Neither "Did Close MacBookd Lid" nor "Did Open Macbook Lid" triggers work

Describe the bug
I created two triggers like described in the title, and they both have one action to run AppleScript Blocking, I tried async in background but that didn't work either. The Applescript makes the Amphetamine app start a new 15 min session, I tested it and it worked in macOS' AppleScript editor as well as "run script" in BetterTouchTool:

tell application "Amphetamine" to start new session with options {duration:15, interval:minutes, displaySleepAllowed:false}

When I would close my lid, wait 10 seconds, then reopen my lid, the session would not start, meaning neither trigger works. Right now, I want both triggers to work with this AppleScript.

What I want in the final thing is to start a 15 min session when the lid is closed, and end a session (which can be done with this AppleScript: tell application "Amphetamine" to end session). How would I know when it works? I use the Jump Desktop remote desktop app. I would connect from iPad to Mac on Jump Desktop before closing the lid, close the lid and if the 15 min session trigger works then Jump Desktop should still be connected and controlling my mac (I could see windows move around when I do so with the cursor). Jump Desktop works while Mac Lid is closed and an Amphetamine session is active. Then when I open the lid, the session should stop. I can easily see if a session is going or not depending on how the Amphetamine icon looks (it changes depending on its state).

Affected input device (e.g. MacBook Trackpad, Magic Mouse/Trackpad, Touch Bar, etc.):

Device information:

  • Type of Mac: 2021 16' MBP, M1 Pro
  • macOS version: Monterey 12.6
  • BetterTouchTool version: 3.914

I clicked BetterTouchTool > Check for alpha version updates, and it says up to date.

The "lid did close" action is really only helpful if amphetamine is already running - otherwise macOS will go to sleep before (or while) BTT can trigger the action.

Possibly the "before mac goes to sleep" action could be used, but it might also already be too late to cancel the sleep here.

Then do u have any ideas for what I'm trying to get done?

Try "did lock screen" as trigger