Cumulative Density plot in vega-lite

I created cumulative density visualization using this example of vega-lite as shown below:

Now, I wanted to convert it to bar chart. So I changed markArea() to markRect() and added bin(true):

The second plot shows no bars for range 240-300, presumably because there are no students with D value between 240 and 300. But why is this so? My understanding is that it should show bar of exact same height as that for 220-240 something like first chart. At least first chart does not show such gap at 240-300.