I had a terrible time with this step, which doesn't mention that the tiny black clip holds the sensor in place. I finally got the clip off, and the sensor out, but the tiny black clip was deformed and I had a horrible time getting it back into place. All of the various ribbon cables are really working against you, too. The black clip is so tiny that it's very hard to align properly on the sensor (it wants to flip onto it's back and "turtle") and often pressing on it to snap it back into place simply bends it rather than locking it on.
I had accidentally broken the ribbon cable near the logic board connector for this whole assembly; now that the phone is back together, everything works EXCEPT the light sensor that I had to manipulate so extensively. I'm assuming I damaged either that portion of the cable, or the sensor itself, struggling to get it back into place with the clip.