I would recommend using a different version of that code. That old version is a hard close and can cause issues with emulators not saving save states properly. It was something that was found last year. I would use the code below instead. Not that the prior one did not work, this is just a cleaner shutdown process.
$Esc::
{
WinClose, ahk_exe {{{StartupEXE}}}
}
More appropriately since Cemu use Alt+F4
ESC::
{
SetTitleMatchMode, 2
WinWaitActive, Cemu
Send !{f4}
}
All scripts to close a game while in the game go in the "Running AHK" within Launchbox. The "Exit" script tab is for issue closing from the LB Pause Menu.