Good question :)
In Polish, even though technically the word "przypadek" does indeed mean "case", in this case (pun intended), it can only mean "accident" because in Polish we would never say "This was not the case" literally and keep the same meaning it has in English.
What we would say would be either "To nie o to chodziło" or "To nie to". The first one would make no sense in English when translated literally ("It didn't went about it"...?), the second one would be "It's not it" which you could actually say in English.
I think it may become clearer once you know that the word "przypadek" is related to "przypadkowo" so the sentence "To nie był przypadek" could also be said like this: "To nie zdarzyło się przypadkowo" - that would be "This didn't happen by accident".
I hope someone else manages to explain it better as it's a very interesting "case" ;) You've provided the correct literal translation of the Polish sentence, but in Polish this sentence would never have the meaning your English translation has.
I see Jellei already replied before I submitted this so FWIW, I wasn't referring to your explanation when I said I hope someone else explains it better :)
Although "a case", like "a case that an investigator investigates" can be translated as "przypadek", in my understanding of your phrase I'd probably translate it as "(To) nie o to chodziło" (It wasn't about that) or "Nie w tym była rzecz", which sounds quite weird in a tense different than Present.
And of course it's not about any car accident or anything like that - it didn't happen by chance, it was on purpose.
"Przypadek" is a "case", but can also be used as "coincidence" (To zdarzyło się przypadkowo = It happened by coincidence).
"Wypadek", on the other hand, means "accident" (Mój ojciec miał wypadek = My father had an accident).
Now, Duolingo uses "accident" in the English sentence here, but only in the context of something happening by coincidence or "by accident" while the Polish wypadek refers to accidents such as a car accident or some other health- or life-threatening accident.