Improvement or repeating does not change your first passing year. Your attempts are counted from the year you first passed Class 12.
For JEE Main 2027, you must have passed Class 12 in 2025 or 2026, or be appearing in 2027. The bulletin is clear that an improvement attempt is not treated as a first attempt.