As the Federal Reserve has aggressively raised interest rates over the last year to fight inflation, shorter-duration bonds have offered higher yields than their longer-duration counterparts.