You gotta factor in the rest.
Let's say the rest is the same for both, and for the sake of the experiment the rest is 90 seconds. The 400s are done in 90 seconds, the 800s are 3:20
12 x 400 in 90 secs with 90 second recov is:
34.5 minute workout with 3 miles run at 6:00/mile pace in 12 segments. 16.5 minutes of rest/recovery.
6 x 800 in 3:20 with 90 second recov is:
27.5 minute workout with 3 miles run at 6:40/mile pace in 6 segments. 7.5 minutes of rest/recovery.
Once you deconstruct the workouts this way, you can see that the stimulus is much different. It is not the same 3 miles of running done faster when you do 400s.
Ideally, you would do the 400 workout earlier in your training buildup, and the 800s later. If your progression goes as planned, maybe you slow down less one you get to the 800s. Maybe you are running them in 3:05.
Phase 1: 12 x 400
Phase 2: 8 x 600
Phase 3: 6 x 800
Phase 4: 5 x 1000
That's kind of a nice progression of workouts for someone trying to improve at the 5K distance.