Looks like Windows 11 optical audio is faulty.
When I run an audio check on my reciever Windows is only sending 2channel audio. Even when I play a 5.1 audio the rear speaker audio is played from the front speakers.
I have tried everything I can but it just looks like it doesn't work correctly.
Speaker setup does not work on optical.
Audio test works incorrectly too.
It is not faulty.
You don't have 5.1 optical because you didn't pay for it. Your computer manufacturer (Dell/HP/Lenovo) or your motherboard manufacturer (ASUS, Asrock, Gigabyte) didn't pay Dolby Digital for your specific computer model. If you use the Netflix app on your computer, you will have 5.1 optical because Netflix paid for Dolby Digital for the Netflix app. This is also why Netflix said that if you use your browser to watch Netflix, you will not have 5.1 (because Microsoft didn't pay for Dolby Digital).
https://help.netflix.com/en/node/14163
Take the Realtek ALC898 audio chipset, it is lited as 8 channel (ALC8xx) so it is 7.1 capable. It is 7.1 analog only.
https://www.realtek.com/en/products/computer-peripheral-ics/item/alc898
S/pdif was invented back in 1983 with the CD. It has only enough bandwidth for 2 channel uncompressed audio. In order for optical cable to send 5.1 audio, it has to send proprietary compressed Dolby Digital codec --- which the Realtek website clearly stated that it is an optional feature for the ALC898 chipset.