Possible causes of scatter charts labels (on dots) updating to the wrong positions?

Hi all,

I am using svelte in my project and I have a scatter chart, whenever the data updates the dots move to the right positions and most labels (dot annotations) do too.
However there are some labels that don’t move all the way and hence forth gets stuck until the data changes completely.

I previously had updated the scales via svelte’s “$” which worked amazingly well for all other charts.
I stopped this and now update directly in the “plotchart” function but the issue remains.

Is it possible that I am not doing updates on text elements the right way?

this is my label updates:

dotLabels
    .selectAll(".fixedLabel")
    .data(plotdata, d => d.player)
    .join(
        (enter) => enter
        .append("text")
        .attr('class', 'bar-label text-xs fixedLabel')
        .attr("x", d => x(Number(d[xvar])))
        .attr("y", d => y(Number(d[yvar])))
        .text(d => d.player)
        (update) => update
        .transition(t)
        .attr("x", d => x(Number(d[xvar])))
        .attr("y", d => y(Number(d[yvar])))
        (exit) => exit.remove());

I’ve been at this for about 2 weeks now I can’t really think of anything else to try.
If someone has an idea, or experienced something similar that’d be great to let me know.

edit: as additional info, the texts and dots get the same x and y positions according to console.log inside the updates. Which makes this doubly weird.

Well, I found one of my mistakes (not all because this happened before I had added this feature already)
but its much less frequent if I remove it.

I think the updates and calls are happening in parallel.
So dedupeLabels(dotLabels) actually updates dotLabels while dotLabels is updating.
So at least getting rid of it, but then sadly having overlap gets rid of the issue.

If anyone has an idea on how to delay it let me know please.
I tried calling it in a proxy function after calling all the plotting but the same issue somehow persists.