Here's the sentence.
I just arrived home last night when I remembered that I had left my keys in the office.
and...
- I think just doesn't work here because of last night.
Just could mean a relatively short while before the other action happened or an approximately short while before the other action happened, which are not specified.
So, Just can't be compatible with "last night", which is quite specific time.
- And I think arrived(past perfect) is not a good choice
The words like when, just, before, after, as soon as, by the time are used to sequence the actions.
So, when we want to speak past actions that happened one after the other with the words when, just, before, after, as soon as, by the time,
we have to use past perfect instead, which makes sure that one happened before the other did.
.
As a result, I think the original sentence should be chanced like...
I had just arrived home last night when I remembered that I had left my keys in the office.
or
Last night, I arrived home and remembered that I had left my keys in the office.
Am I right to think this way?