Solved, the main issue was the [selectedCoords, setSelectedCoords] = useState({ lat: 18.220833, lng: -66.590149 }); For some reason, the InfoWindow kept using the initial state while the AdvancedMarker updated correctly. Changing the initial state to null fixed the issue:
const [selectedCoords, setSelectedCoords] = useState<any>(null);