@Din1,
"Wasn't I invited to the party?"
This implies that you are not sure whether you have been invited or not, and you are asking for clarification.
-----------------------------------------
Why wasn't I invited to the party?
This confirms that you know you haven't been invited, and you are wanting to know the reason why.
The 'wasn't' element may (I only suspect) look and sound strange to some, maybe all, Americans, as I have noticed that it is rare to see the shortened form in their posts here.
Wasn't is usually was not.
Can't is cannot.
Isn't - is not. Etc. Etc.
Some do, but most never seem to abbreviate such terms. Maybe it's a Brit/Aussie thing.