The opening of the next candle

when your watching your chart and a new candle forms, how come sometimes the candle doesn’t form at the close but halfway or better up/down from the close? That really screws me up sometimes.

Just happens to be a new candle forming when the price ticked is all.