Retirement tax questions

The cost basis reported on the 1099-B was less than the face value of the CD and therefore a gain was reported, so I am not sure I follow your example.  According to your reply, does this mean the market (interest) rate was less than the rate when the CD was first purchased?  I received the face value of the CD at maturity plus the remaining  3 months of interest due at the original rate (not the market rate on the date of death).  My tax documents included a 1099-B for the difference in the cost basis and the face value of the CD and the interest I received.  By the way, the gain was more than the interest.

According to your statement, as the CD gets closer to maturity, and the value moves closer to face value, shouldn't the gain get closer and closer to zero, therefore the gain would no longer be applicable?