This behavior is perfectly as expected. If you have "show my windows and tabs from last time" selected for "when Firefox starts" in options, Firefox opens those for the first Firefox instance you open and then discards them. Subsequent instances open with the home page.
When you close a window Firefox saves the list of open tabs for next time. When you close a second window after the first one that first list is overwritten. That's the reason you lost the pinned tab, and the reason the pinned tab is preserved when you close A after closing B.
It would be possible to retain the list of open tabs even after a first instance starts, so that the second instance also opens those tabs, but I'm not aware of an add-on which does that.
BTW, you don't have to pin the tab to have it reopened. See Options | General | Startup.