Ah, that sounds awesome! I'm continually happy to hear new things non-human animals can learn to do.
Oh, shit...I'm sorry.
Just FYI, I'm absolutely OBSESSIVE about not having windows opened more than a few inches. Specifically, they cannot be opened enough to allow a cat to fit. Many years ago, two of my Great Danes had a little tiff in the living room, I came running to see what was happening, and at some point I noticed one of the front window screens was gone (the windows were fully open). And so was my favorite cat. Everyone in the neighborhood knew us and we were on very good terms with them, so the whole neighborhood, plus Animal Control, was on the lookout for him...but I never saw him again.
I've actually had to walk my helper through the logic so she'd grasp it. "You leave your window open and then go to the kitchen. Joy Noelle detaches herself from my body long enough to go to your room, and jumps up in the window. The screen falls off. Depending on whether the alarm is set, either the door chime will sound or the alarm will go off. If the door chime sounds, I--in my bedroom--will assume YOU have opened a door. YOU would most likely not even think about it. If the alarm went off, let's say you weren't home, I'd jump up and run to the panel to see which station set it off, and by the time I got to your room, guess what? Joy Noelle would be long gone!"
I think you're the first person I've ever met online who'd experienced the screen-falling-off thing, resulting in losing a pet, although I frequently see NextDoor and Ring alerts from people who've had it happen. I'm sorry that happened to you. I imagine it was devastating.