After you file

as noted before, If your 1040-X shows Schedule D with the correct amounts (non-zero) for those lines.

then you use those corrected figures from the carryforward worksheet on your 2024 tax return.

 

Even if you did not amend 2023 , you would want to do that with 2024 and take your chances with another IRS review.

 

If you never get the $661 back you have used up $3,000 to no avail (already filed).

If/When you use up another $3,000 in 2024 you should get the 2024 $661 back.

you can decide what to do next year.

@Bob in Plano