The sentence (A) isn't correct grammatically.
"I couldn't open the door" is in the past. As a matter of fact, you are locked in and unable to open the door at the present time. So the correct sentence should be:
I am locked in here and cannot open the door. Can you help me?
The second sentence (B), which is in the past, is correct grammatically. Could is the past of can.
The choice of tense here is somewhat restricted by the meaning of expect, which means to anticipate that something will happen. When we expect something, we believe it will happen; we await it.
When that which we expect to happen turns out to happen or to not happen, we no longer have the expectation. The expectation is abandoned either because now we know otherwise, or because what we expected to happen has indeed happened. When it has rained cats and dogs and our shoes are already ruined, we cannot expect them to get ruined. We cannot expect the 4PM train to be late if it is 4PM and the train has already arrived on time.
If we are speaking of an expectation as either an ongoing state of mind or as an abandoned state of mind, we do not use the present perfect with expect . If the expectation is abandoned, it is a thing of the past.
What did you expect?
What were you expecting?
If the expectation is ongoing, it is a thing of the present.
What do you expect?
What are you expecting?
Only when we wish to speak of the expectation as one that may be in transition from held belief to abandoned belief does expect hook up with the present perfect, though even then the two are awkward dancing partners.
What have you been expecting?
What have you expected?
What have you been believing?
What have you believed?
The present perfect could also be used to mean "things that I have believed over the course of my lifetime which I no longer believe, but I own to having believed them".
Have you expected Santa Claus to come down the chimney?
Have you expected the Tooth Fairy to leave money under your pillow?
Have you expected business partners to be honest and above-board?
Best Answer
Whatever "that" is, it's done. That's why you are saying did instead of do. This is an expression of regret.
Whatever "that" is, it's not done yet. This is trying to tell someone not to do something.
This can have a "conditional" meaning, and that means there's an if X or because X somewhere that applies to this, either mentioned previously or assumed by the listener.
This can also be a polite or "softer" version of "I don't want you to do that."
This can also be "will in the past" - and basically be a "past tense" form of "I will not want you to do that" referring to something already done - this could be used if a person A did something, thinking someone else B wanted him/her to do it, but A did not want that to be done.