X-ray photons from energetic sources such as gamma-ray bursts (GRBs) can be scattered on dust clouds in the Milky Way, creating a time-evolving halo around the GRB position. X-ray observations of such halos allow the measurement of dust clouds distances in the Galaxy on which the scattering occurs. We present the first systematic comparison of the distances to scattering regions derived from GRB halos with the 3D dust distribution derived from recently published optical-to-near infrared extinction maps. GRB halos were observed around 7 sources by the Swift XRT and the XMM-Newton EPIC instruments, namely GRB 031203, GRB 050713A, GRB 050724, GRB 061019, GRB 070129, GRB 160623A and GRB 221009A. We used four 3D extinction maps that exploit phot...