SGB: Is my Gain interest free even if I buy SGB from Stock Market?

Let’s consider the following scenario:

  1. I bought 1 unit of SGB issued in some tranche in 2016.
  2. I made a purchase through Zerodha in 2021.
  3. The SGB is going to mature in 2024.
  4. I hold the SGB till maturity in 2024.

Will my gain on SGB from 2021 to 2024 be taxable? Because technically my lock-in period is only 3 years(2021-2024) as opposed to if I would have bought in 2016 it would have been 8 years(2016-2024).

Interest income will be taxable, Capital gains is exempted from tax.