Rank function creating duplicate partitions? (two rank 1's for the same key)
Found the problem, there were ties in the rank ordering, hence why multiple rows are returned with the same rank id.

The solution will be for me to find an ordering key that has unique combinations of partition and order key.