The doctor who wrote Why We Sleep do not recommend those sleeping pills IIRC.
Sleeping pills do not provide natural sleep, can damage health, and increase the risk of life-threatening diseases. (p. 282)
On Ambien specifically:
If you compare natural, deep-sleep brainwave activity to that induced by modern-day sleeping pills, such as zolpidem (brand name Ambien) or eszopiclone (brand name Lunesta), the electrical signature, or quality, is deficient.
[1] https://en.wikipedia.org/wiki/Why_We_Sleep [2] https://www.youtube.com/watch?v=aXflBZXAucQ