I purchased stock for an investment account, then
recorded dividends (either cash or reinvested) over a
period of time, then sold the entire amount of that
stock.

Sometime later the same stock is again purchased. Money
shows the dividend income for the previously sold shares
as part of the Gain in the Your Portfolio screen
(Standard View).

Any ideas on what I might be doing wrong?