Did Draco purposely get detention to give him an alibi for when Katie gets cursed?

After Harry tells Prof. McGonagall that he thinks Draco cursed Kate, she tells him it couldn't have been Draco because he was in detention with her for not turning in his last 2 homework assignments. While he could've not turned in his homework because he was stressing about having to kill Dumbledore and/or trying to fix the vanishing cabinet, we never hear any other professor mention he was missing work. If Draco was constantly in detention for missing homework assignments, he never would've had time to fix the vanishing cabinet. Draco knew Harry was suspicious of him because of what happened on the train so he probably assumed that Harry would immediately accuse him.