Well, I’ll be damned. It was that hahaha.
I’m 90% sure that back when I built the Statistics dashboard (September 2017) every admin color scheme had four colors (too lazy to install an older version of WordPress to confirm). There’s also a good chance that I might be wrong about that, that Modern has always have only three colors and that this whole issue is completely my fault (it’s still my fault, but even more so if that was the case).
The code that renders the Stats chart uses the last two colors of the user’s selected color scheme to style the chart. Modern only has three colors, and when the code tries to use the fourth color (missing in Modern) then, well, a JS error happens which breaks the rest of the script ??
I would have never noticed that on my own so thank you really for helping out with this! I finally fixed that issue after so long! Will publish version 5.4.2 as soon as possible (will probably wait for a bit, would hate to have to release 5.4.2 so soon and just to fix one issue hehe).
In case you’re curious / don’t want to wait until 5.4.2 is officially released, this is the commit that fixes the bug: Fixes Stats chart not loading for some users.