I have not reviewed your tree and sources. There are the following logical possibilities.
1. The Josie who married James is not the same as the Josie who married Sterling. Be sure the names identify the same person and there are not other persons possibly described by the documents. Are there other sources on these marriages?
2. The Josies are the same, but the James that Josie married actually died before Josie married Sterling. Be sure your documentation of James's death date is correct and correctly identifies Josie's first husband and not some other person.
3. Josie and James obtained a marriage license in 1866, but they never actually married (the "cold feet" scenario). The clerk's records, if they exist and are correct, should indicate if and when a return of marriage showing the marriage date/place was filed.
4. Josie and James married, but obtained a divorce or annulment in Texas prior to the 1868 marriage. While no-fault divorce did not exist anywhere in the USA prior to 1969, sources show divorces granted in Texas as early as 1838 or 1840. These could be for a legitimate or pretextual cause.
5. Josie and James married, but obtained a legal divorce or annulment in another state or country prior to the 1868 marriage. Divorce tourism and forum shopping has a long and storied history.
6. Josie and James married, but never obtained a legal divorce or annulment, and so Josie and Sterling contracted a bigamous marriage, falsely stating that Josie was single or divorced in order to obtain a license. Josie might have done so either knowingly, or inadvertently if James had falsely told her he had obtained a divorce and provided fraudulent information/documentation.
A written marriage license application might indicate marital status and any prior marriages at the time of marriage; which may or may not be preserved or available, whether or not it's electronically indexed/scanned.
Hope this helps.