Audio output gone, "internal speaker" device disappeared
My situation was NEARLY as you described -the issue was on a mid 2011 27" iMac. I had recently replaced/upgraded the original 1TB HDD with a 4TB HDD thinking/hoping it would resolve a problem with vertical lines on my monitor. It did just that, briefly, but then about a day later, the problem returned. I swallowed hard, opened up the iMac again, and replaced the graphics card, upgrading from the original 1GB to an AMD Radeon HD 6970M 2048 MB. To do that, it was necessary to completely remove the logic board as the graphics board connectors are on the back of the logic board (thanks a lot Apple!). It all went back together well, and everything but sound is perfect. It's possible that I could have damaged the logic board at some point, but it seems likely something else given the number of complaints about this with nothing being done internally. Whereas the original poster had NO system out options, I had one - digital output. Internal speakers option had disappeared, although internal microphone and line input functions remained normal.

All the tricks described in detail in others places failed to work, headphones connected to the jack do NOT function, but using a Bose wireless Bluetooth headphone works normally. The solution for me was rather than pour any more $$ into this old machine that is no longer my primary computer was to purchase and pair a Bose portable speaker with the iMac. The sound is much improved over the old internal speakers, I can leave it on it's charging pad to have continuous sound, and I can take the speaker anywhere I want pairing it to the iPhone X or an iPad.

The only thing bugging me is that I couldn't figure it out, but not worth wasting any time over either. Hope you've solved your problem.