I found the same behaviour on IOS XE 16.6.4, 16.8.1s and 16.9.1. I tested with Catalyst 9500 and 9300. With IOS 16.6.3 speed auto negotiation works, but when I upgraded one switch the link did not come up until I configured speed nonegotiate.
Before workaround:
interface FortyGigabitEthernet1/0/1
switchport mode trunk
end
C9500#sh int statu
Port Name Status Vlan Duplex Speed Type
Fo1/0/1 notconnect 1 full 40G QSFP 40G CR4 SFP
Fo1/0/2 notconnect 1 full 40G QSFP 40G CR4 SFP
Fo1/0/3 connected 1 full 10G SFP-10GBase-CX1
Cat 9300:
interface FortyGigabitEthernet1/1/1
switchport mode trunk
end
Switch#sh int statu
Port Name Status Vlan Duplex Speed Type
Fo1/1/1 connected 1 full 40G QSFP 40G CR4 SFP
Fo1/1/2 notconnect 1 auto auto unknown
After workaround applied on Cat 9500 witch IOS 16.9.1:
interface FortyGigabitEthernet1/0/1
switchport mode trunk
speed nonegotiate
end
Aug 10 18:29:57.275: %LINK-3-UPDOWN: Interface FortyGigabitEthernet1/0/1, changed state to up
Aug 10 18:29:58.359: %LINK-3-UPDOWN: Interface FortyGigabitEthernet1/0/2, changed state to up
Aug 10 18:29:59.281: %LINEPROTO-5-UPDOWN: Line protocol on Interface FortyGigabitEthernet1/0/1, changed state to up
Aug 10 18:30:00.363: %LINEPROTO-5-UPDOWN: Line protocol on Interface FortyGigabitEthernet1/0/2, changed state to up
C9500#sh int statu
Port Name Status Vlan Duplex Speed Type
Fo1/0/1 connected trunk full 40G QSFP 40G CR4 SFP
Fo1/0/2 connected trunk full 40G QSFP 40G CR4 SFP
Fo1/0/3 connected 1 full 10G SFP-10GBase-CX1