Why do some coffee beans produce more dust than others when ground? I've noticed that at the same grind setting (medium grind), some coffee beans produce a ton of dust when ground, while others barely have any dust. I'm thinking it has to do with the roast level, but I'm not completely sure.

What factors affect how much dust is produced when grinding coffee beans?
(1) Burr grinders are known for more precision and consistency than blade grinders.
(I haven't tried a blade grinder, but Specialty Coffee says

Now, once the grinder is loaded, don't just hold the button down and let it rip... use short bursts of a few seconds each so the coffee doesn't overheat.
Make sure you have a hold on the top of the unit and give it a shake during bursts so that the grounds get well mixed while grinding. This will make the grind much smoother and consistent.

Be careful that some &quot;burr grinders&quot; have blades and burrs.)
(2) Cold beans grind more consistently. Per NY Times:

But to achieve consistent flavor you may just need to chill your beans before grinding them. Colder beans produce smaller, more consistently sized particles when ground, yielding more flavor from less coffee, according to a study published in Scientific Reports.
As room temperatures vary and grinders heat up with use, the consistency of the resulting grind changes. That’s a problem, because water extracts flavor from smaller coffee grounds faster than bigger ones. An inconsistent grind means sour taste from the small grains, and a bitter one from the big, all at the same time.

(But I'm pretty sure that last sentence is reversed.)
Note that some grinders heat up with use.
(3) Different bean types, roasts, and ages might produce more dust than others when ground, but I don't have good info on that.