It fails because we are using polymorphic models here. It checks for the maximum priority on the actual model, but there is no objects there, so it starts from 0 again, but there is another model --using the same db table-- with priority=0 already, so it fails. We need to filter by all polymorphic models to fix this.
I didn't want to deal with that just now, so I skipped this positioning for now since we will create the objects manually from the Django shell for now.
The code is at https://github.com/readthedocs/readthedocs.org/blob/main/readthedocs/projects/ordering.py#L6