I think that you are merging two different uses of "couldn't have" that need to be divided back apart.
- The idiomatic "Couldn't have" that reflects someone's feeling that something in the past is impossible.
- The genuine "Couldn't have" or "could not have" that reflects a true impossibility.
The answer to your question, "When can I use 'could not have passed the test'" is that you can always use this construction when the context or the circumstances warrant it. You don't have to worry much about accidentally straying into the territory of the idiomatic usage of "couldn't have" when you don't mean to, and you also don't have to worry about being misunderstood by people as to which of the two usages you're employing at any given time.
Here are some examples labeled with [1] or [2] that will hopefully show the difference between the two kinds.
- I couldn't have passed a physics exam. I'm only in 3rd grade. [1]
- I couldn't have passed the physics exam. I was sick, and then my girlfriend left me, and I never studied, so there was no way I could have done it. [2]
- I couldn't have passed the test. I didn't even show up to take it. [1]
- I could not have passed the test without the help of my tutor. [2]
- I couldn't have passed the driving test. I've never driven a car in my life. [1]
- I could not have passed the driving test. No matter what, that particular driving instructor always gives a failing grade to women drivers. [2]
In a situation where you didn't have the clarifying follow-up sentence (and were simply hearing someone say, "I couldn't have passed the test"), I would typically gravitate toward interpretation [1] for all situations, unless you had strong reasons from the context to believe otherwise.
Also, I would differ from your interpretation on Case 2. I would say that in Case 2, it would be correct to say, "I couldn't have passed the test" and NOT "I can't pass the test." I would only use "I can't pass the test" in a case where the student was speaking before even taking the test.
The [finite form of to be] + present participle is used not only to denote continuous states or progressive actions but also informally, I submit, the ingressive or inceptive aspect, i.e., that an action or state has begun. Neither statal nor copulative/pseudo-copulative verbs are always exempted, especially in informal speech. There are other uses which have nothing to do with aspect but are used as intensifiers and polite hedges.
Some forty minutes into an hour baking time for fresh bread, the Malliard reaction is doing its magic:
That bread is smelling good.
I am not suggesting that the bread is in a continuous state of smelling good, but that the bread has begun to smell good (ingressive aspect) and it's time to get the butter out of the fridge, because I'm fixing to have a big slice of homemade bread (prospective aspect, but only for some speakers of Southern American English).
In a more formal register, I would say:
The bread is beginning to smell good and I'm about to have a slice of homemade bread.
Think of any food that looks unappetizing before cooking — steaks on the grill, a stew simmering for hours, dried beans — and wait for The Moment.
By like token, I could be mixing the hot and cold water to get just the right temperature for a bath or shower:
The water is feeling nice and warm now.
The water has begun to feel nice and warm now.
This apparently meme-worthy citation describes an emergent feeling of loneliness or contingency upon contemplating the vastness of the universe (ingressive aspect) using the meaning of seem as "seem to feel" and in the continuous form, accentuating a moment of intense emotion right now. It invites the reader to identify with the author in a way which to her apparently wouldn't be as rhetorically powerful as simply saying the universe seems huge. The universe, of course, has been huge since the Big Bang and it always is, but in this moment, she has begun to feel it.
At work he's a total jerk.
He is being a total jerk [today at work].
This usage is best solved by acknowledging a lexical difference: in the present tense one is making a judgment about his personality; in the continuous, instances of behavior, in this case, today.
Permanet states or non-animates without agency can never be used with the continuous:
*She is being Australian. (nationality, not in some odd scenario behavior)
*He is being short.
*My shirt is being green.
You are looking pale today.
You are looking fabulous today.
While the first sentence could be parsed as ingressive, this usage seems more like a polite hedge, while the second is best viewed as an intensifier which, like the meme, suggests a heightened level of personal involvement.
Best Answer
At all is a Negative Polarity Item (NPI). That means it is one of a long list of English words, phrases, idioms, and constructions that can only occur grammatically in a Negative environment.
Rather than being "awkward" or "ugly" (which are esthetic judgements and not grammar),
is simply ungrammatical, since there is no negation present to license the use of at all. So it's incongruous here; what could it possibly add to the meaning in such an environment?
In a grammatical sentence, say,
at all functions as an intensifier of the negation, meaning something like 'in even the most insignificant manner'. But without a negative environment to license it, at all makes no sense at all.
There's a lot more to say about Negation and Negative Polarity, but this is a very simple case.
Edit: Specifically, just to get it all on the record, for the future, here's the list of Negative Triggers from http://www.umich.edu/~jlawler/NPIs.pdf. (If-Clauses fall under "III. Hypothetical Clauses)
Negative ‘Triggers’
Notes:
The first few sentences give grammatical negatives versus ungrammatical affirmatives. After that you're expected to find your own ungrammatical affirmatives. (It's rather fun, actually; they really sound terrible)
I. Overt negatives:
A. not [w/ NPI clausemate or complement]
*He (did know/knew) anybody.
He didn’t think (that) he knew anybody.
B. Incorporated negatives
I doubt (that) he knows anybody.
I kept her from telling anybody.
C. Negative frequency adverbs
I seldom/rarely see any of them.
He hardly/scarcely knows anyone.
D. Quantifiers & quantified adverbs
Only Bill did any of the homework.
II. Questions (overt and embedded)
III. Hypothetical clauses.
IV. Comparatives, superlatives, etc.