An inventor on a patent is not the same as an author on an academic manuscript. Each inventor must be creatively involved in developing the intellectual property.
An author on a patent contributes to
- conception and/or
- reduction to practice
Order of "authorship" has no legal consequences.
However, having people on the patent who did not contribute to the above two points, or not on the patent who contributed to the invention can have legal consequences where the patent can be invalidated.
More on the definitions summarized briefly by university of New Hampshire.
Each jurisdiction is different. This Bios free public patent resource page covers with examples, author vs inventor by jurisdiction.