Certainly (4) is grammatical, and can be proved by a counterexample:
Last night I could hear the clock [on the town hall] strike two, but by three the wind was in the wrong direction.
That is, the clock did strike two, and it was possible for me to hear that. It is an affirmative context of a matter of actualisation of a single situation viewed perfectively. CGEL is wrong to proscribe it, although its alternative was able to (also mentioned on p197) can be applied successfully.
That is sufficient to cast doubt on sentence (2), and while "I could hear something rattling" is probably more likely to be said, "I could hear something rattle" is not unidiomatic. Shoe's comment "In fact, perfective (rattle) implies a short burst of sound as against a more prolonged sound in the imperfect (rattling)" is apposite.
The problem with prescriptive grammar is that it cannot cover all possibilities, and dogmatic assertions such as the one you ask about may well not be right all the time.