'Could' is past of 'can', and it shows ability to do something. For example, "I could not assist him." However, I have a doubt on its use when it's compared with using "did not", as in following sentence:
It was raining yesterday, so we could not go out.
It was raining yesterday, so we did not go out.
I had to chose one of the above-mentioned sentences since this was asked as a multiple choice question in my job test (Q. No. 35):
About the use of "could not" I have also seen Cambridge Dictionary using "could not" in somehow a similar manner.
The difference between the job test question and Cambridge Dictionary's example sentence lies in the first clause, it was raining (shows past progressive) and the bank had closed (implies past perfect).
Pondering further over the question, the use of "could not" and "did not" might also seem confusing for native learners when it comes to using the conjunction "so" prior to "could not" or "did not." However I am not sure, but I do know the meaning of "so" as to give reason to something happened, happening, or will happen.