It turns out the solution to this problem is surprisingly simple: run your dustpan under running water first.
As Apartment Therapy explains: “You know when you come out of the shower and dry off, but your feet are still a little damp and you walk around and they are like magnets for all the gross stuff (hair, dust, dirt) on your floors? Wetting your dustpan before you sweep works the same way, but where you want it to happen.”
Although this hack makes collecting household dirt easier, transferring it into the bin does become slightly more difficult when wet. However, this can be solved using an old rag to wipe the pan out.