Why is Cannabidiol extract so expensive

From looking online, a gram of Cannabidiol (CBD) runs about $500 in various formulations (gels, pills, oils, etc) and various concentrations.

That makes no sense. Isn’t an ounce of high CBD strains like Charlotte’s web or ACDC cannabis about $500 in states with medical marijuana, and Charlotte’s web is something like 20% CBD which would work out to almost 6 grams of CBD for $500? I have no idea, but don’t most strains in states with medical cannabis top out at $500 an ounce?

Why the price discrepancy? CBD is legal in all 50 states as far as I know, but medical marijuana is not. But that alone doesn’t seem like it would explain the price difference. If CBD is legal everywhere, shouldn’t it be as cheap on a dollar per gram basis as high CBD strains in states with medical marijuana?

So if CBD oil/gel is legal in all 50 states but costs $500/gram but medical marijuana is legal in only some states and runs closer to $80/gram (I assume), what is the explanation for that?