How to handle both interest and capital gains on US Treasury Notes purchased at a discount

In 2024, I made several purchases of US Treasury Notes that matured in about 6 months,  9 months, and 12 months. My understanding is that these notes are purchased at a discount (less than face or par value) and pay back at face value at maturity. The difference is the interest you earn, reported on a Form 1099-INT.

 

That seemed to be true for some of the Notes but not for others. For some, I also received a Form 1099-B showing short-term capital gains. Fidelity told me this is because I purchased the bonds at a discount. But all US Treasury Notes are purchased at a discount.  Here are the details for two groups of Notes purchased.

DateQtyPricePrinc AmtAccrued IntStlmnt AmtCouponMat Date
1/29/20241397.551012681.63012681.63zero7/25/2024
1/29/20245096.74204837162.8448433.841.00%12/15/2024

 

The $13K notes paid interest and had no capital gains. The $50K notes paid interest and generated capital gains on a Form 1099-B.  For the $50K group, the 1099-B shows Total proceeds of $50,000 and Cost Basis of $48,433.84. Why doesn't the $13K group have a 1099-B showing $13,000 and $12,681.63 for the Proceeds and Basis. This seems inconsistent.

 

Why do some Notes have capital gains and others don't?

For the $50K group, do I pay taxes on both the interest and capital gains?

Thank you