Thank you for the feedback. If I set the '5G Only' mode the phone is able to connect to 5G NSA but it won't connect to 5G SA, whenever is available. This is confusing to me given that I'm able to connect to 5G SA with the same carrier at the same spot using a different user equipment (which is not a Pixel phone).
I'm currently using a Pixel 9a with GrapheneOS and before Carrier settings overrides were implemented I would try to force a change in the "carrier_nr_availabilities_int_array" key from 1 to 2, using the PixelIMS tweak. The app just crashed so that wouldn't work either. Apparently the same tweak did work (therefore connecting to the 5G SA) for some stock Pixel users. I'm getting this info from a Spanish forum.
This is the most closely related issue that I could find https://github.com/GrapheneOS/platform_frameworks_base/pull/246. In fact my carrier (Movistar Spain) is the same as the user there who wanted to merge a pull request. That pull request was closed by a member of the GrapheneOS team noting that it was not the way to fix the problem, which was 5G SA not working.
As long as I'm forcing both NSA and SA modes in the '5G Capabilities' tab of the Carrier settings overrides, phone is able to connect to 5G in NSA mode but not in SA mode. However, a user of the Spanish forum I mentioned earlier says they were able to connect to 5G SA in GrapheneOS using the Carrier settings overrides.
After further browsing and given all the info I found I'm still a bit confused, as this could be a carrier-side issue. If you think so, feel free to close this ticket.
I'll try to contact my provider to see if they are able to fix the issue.
Thank you for your help!