RBS (along with most buyers) didn't realize that the AAA-rated securities they bought were actually subprime-backed (because of completely stupid rules by the ratings agencies, which Goldman exploited)
When people suddenly discovered what a disaster these were, RBS wrote down £5.9bn, and was forced to seek additional capital[2].
RBS was responsible for heir own fate of course. But Goldman sure made money out of it.
[1] http://www.telegraph.co.uk/finance/recession/5025115/RBS-tra...