Missing aggregation on nested field returning incorrect results

I'm trying to do a missing aggregation on a nested field, but it doesn't appear to give correct results.

Full test case: https://gist.github.com/schmichael/131e3a16251e75abd637eed498015ee8

Note I included a nested missing aggregation to demonstrate that doesn't do what I had hoped either.

Reverse nested seems to be what I was looking for: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-reverse-nested-aggregation.html