The only comfort Paul offered the Thessalonian Church was that the dead in Christ would be resurrected when Jesus comes again (1Thess. 4:13-18). Likewise, 1Corinthians 15, the resurrection chapter, puts forward no hope other than the resurrection of the dead.
Looking at 2Cor. 5:8, in context, we note the following:
1. The hope expressed in the context is that of resurrection (2Cor. 4:14);
2. The “earthly tent” is our present mortal body (5:1a);
3. The “building from God”, the “eternal house in heaven” (5:1b) is our future resurrection body;
4. The clothing metaphor (2-4) elsewhere is used of the resurrection (1Cor. 15:53-54);
5. The “swallowing up” of the “mortal” by “life” (5) also occurs at the resurrection (1Cor. 15:54);
6. It is in anticipation of this hope that we “groan” (2,4 c.f. Rom. 8:22f);
7. Paul’s use of such terms as “naked” (c.f. 1Cor. 15:36-27 with 42 and following) and “unclothed” describe the intermediate state and it is clear from the passage under consideration that Paul does not desire to be in this state (3,4) despite how Paul’s Greek contemporaries may have felt.
8. Note lastly that the context concerns our appearance before the judgment seat of Christ (10), which occurs only after Christ returns.
Paul speaks only of future resurrection from beginning to end.
So Paul’s controversial words are best understood as teaching Paul’s preference to be away from this mortal body, having put on his immortal resurrection body as a consequence of Christ having returned.
In Phil. 1:23 the use of the term “depart” suggests a journey in which the beginning is death and the end is being with Christ. The “gain” which Paul has in mind throughout the context is that which comes of dying a martyr’s death.