This question already has an answer here:
It was clearly mentioned in Deathly Hallows that you can't curse someone under the Invisibility cloak, since it is one of the Deathly Hallows and Death has given immunity. Even if Dumbledore was the most powerful wizard alive, how did he overcome the power of the Cloak of Death himself; that, too in such a weakened state? Here is the excerpt from the 6th book Harry Potter and the Half-Blood Prince, Chapter 27, page 584... So did i actually find a mistake in the book or is there a proper explanation?
Harry hurried over to the door leading to the spiral staircase, but his hand had only just closed upon the iron ring of the door when he heard running footsteps on the other side. He looked around at Dumbledore, who gestured him to retreat. Harry backed away, drawing his wand as he did so. The door burst open and somebody erupted through it and shouted, “Expelliarmus!” Harry’s body became instantly rigid and immobile, and he felt himself fall back against the tower wall, propped like an unsteady statue, unable to move or speak. He could not understand how it had happened — Expelliarmus was not a Freezing Charm — Then, by the light of the Mark, he saw Dumbledore’s wand flying in an arc over the edge of the ramparts and understood. . . . Dumbledore had wordlessly immobilized Harry, and the second he had taken to perform the spell had cost him the chance of defending himself.
This was while Harry was under the Invisibility Cloak.