Sound only plays from one of the HDMI devices connected to NVIDIA card

Go to the Configuration tab in pavucontrol (pavucontrol --tab=5)
Click on the Profile: drop-down menu for the nVidia device
and select the Profile for the 2nd HDMI output

pavucontrol profiles use different numbering for audio devices to ALSA starting from 1 instead of 0
so the first device in ALSA (HDMI 0) will be shown as HDMI
and 2nd device (HDMI 1) will be HDMI 2

Or use this command to show all the card profiles

pactl list cards