Hate to say it but yes, usage of adipex can contribute to erectile dysfunction. This is a physiological connection to ED. You'll probably go back to normal if you stop taking it. ED is listed as a common side effect. https://www.drugs.com/answers/does-phentermine-affect-sex-drive-436380.html
And unfortunately, ambian is also linked. https://www.healthline.com/health/erectile-dysfunction/ed-and-ambien
Kind of puts you in a quandary. Do you have to take ambian to sleep when you are taking adipex?