There were two people involved in Simon's murder; the killer, and an assistant. The killer unlocked the Office door from the outside OR the door was already unlocked, then gave the assistant the key to Simon's office to hold onto it. Then, the murderer went inside normally after the door was opened and closed it. The killer then murdered Simon and left via the office door, and the assistant gave the murderer back their key to lock the door; the killer then locked the door from the outside.
I keep letting this small detail slip. It's time that you explained it, humans.
Before Alfred opened the office door, only Simon, a witch or somebody who didn't harm Simon could lock the office door from the inside without a key.
- In this context, any person who killed Simon before Alfred opened the door counts too.
So how did they lock the door from the inside then?
The killer entered the Office through the open/shut/unlocked/locked window (via rope, ladder, or whatever and a key or prying object if it's the locked window option). After killing Simon, the killer then closed/locked the window, opened the door from the inside with or without the use of a key (either the door was unlocked or locked), then proceeded to exit out via the Office door, and lock it on the outside. They also removed any potential trace or object that could lead to suspicion of someone using the window as an opening/exit afterward.
You're thinking with windows now, I see. But the doors still get you. ;>
Before Alfred opened the office door, keys that were able to open it were not taken outside through the office door by anyone who already committed murder during the story.
How was the door locked from the outside then?
After entering the office (via the use of a key if it was locked, or simply opening the door because it was unlocked), Simon relinquished (or gave) his office key to the killer before being murdered - possibly, the killer was using 'seduction' techniques to 'restrain' him in an inappropriate situation, as well as persuade him to obtain his key. After the murdered obtained the key, the culprit killed him, and used Simon's key to exit the office door and lock it from the outside. Note that the key was obtained BEFORE the murder still.
parrot.jpg
Before Alfred opened the office door, keys that were able to open it were not taken outside through the office door by anyone who already committed murder during the story.