There are three things to consider here:
- D&D is not a physics simulation
- There are no hidden rules in D&D.
- The rules, especially RAW are only a tool to run a game
Other answers have covered what the laws say, and more importantly, what they don't say. They don't say anything about how magical darkness interacts with light passing through.
This means the "there are no hidden rules" rule apply here, so darkness doesn't cast shadows, case closed.
Except...that would in itself be a hidden rule.
The main problem is that while in the spell's description darkness is a thing that "spreads" and its spread can be blocked by covering its source with an obscure object, "casting a shadow" is not a real thing, it's simply another name for "blocking light".
And while D&D is not a physics simulation, the laws of logic still apply: either light can pass through or it can't pass through, there's no third option.
And if light passes through, an outside observer, while unable to see anything within the sphere of darkness, could see with perfect clarity what's on the other side.
And we've already got a name for that effect: invisibility.
Since there are no hidden rules in D&D, and there is no rule that says the contents of the sphere become invisible, the only remaining solution is that the sphere blocks outside light from passing through, i.e. "it casts a shadow".
But we've already "proven" that this also violates the "no hidden rule" rule, so how could that be then?
Well, the simple answer is: the description of magical darkness is broken. It's broken because you can deduce both that it casts shadows and that it doesn't.
And this is where assumption 3 steps in: the rules are there to help the game, not to break it.
Thankfully in this case the rules are very easy to fix: just bring magical darkness in line with magical silence. In comparison, here's what the Silence spell says:
For the duration, no sound can be created within or pass through a
20-foot-radius sphere centered on a point you choose within range.
There, nice and clear, and crucially, intuitive. Which is important if you prefer understanding the world you play in without a degree in law and formal logic.