Hello! I'm not an English teacher but I am a native speaker of the language. The sentence seems to be grammatically correct! As I'm sure you know, phrases and words in English can often be switched around and the sentence would still make sense.
For example, saying, 'I wouldn't be upset if I had known you weren't coming' is also correct.
I hope this helped you!