눈을 감기다 is incorrect, but 눈이 감기다 is correct
눈을 감다 is sound like he intend to close his eyes with his wll
눈이 감기다 is sound like his eyes is closed without his will
for example, 저절로 눈을 감다 is incorrect. but 저절로 눈이 감기다 is correct
잠에 눈이 감겼다 is correct, but 잠에 눈을 감았다 sounds awkward to me. (I don't know it is grammatically correct, but it is awkward.)
잠을 자려고 눈을 감았다 is correct, and 잠을 자려고 눈이 감겼다 is incorrect.