Typespecs are not checked by compiling the code, but only by external type checkers like dialyzer and others. Therefore in a context where such checkers are not (regularly) used it‘s easy for mistakes in typespecs not to be caught.
I’m the person that wrote this. As per the other comments yes this is 100% a mistake (mine) and probably because I copied and pasted something wrong or completely misunderstood something at the time. As you can see I then changed the function and never updated the type spec which isn’t great of me.