I know that "Could have" can be used to express a sense of regret about past events:
- We are already late. - We could have chosen the right way if you had not forgotten a map.
But I wonder if it can be used to express the same thing but in a positive way, let's call it "a sense of gratitude to fate":
- Look, somebody is hit by an avalanche!!
- That's terrible! It could have been us. /No joke intended/
Is the last sentence correct? If not, how would you say this?

