Custom Element disappears shortly when connectedCallback is called

Since my custom element code is more than 200 lines long, I’ll have to break it down a bit so please bear with me. So as you can read from the title, my customElement disappears shortly and the reappears (it looks like it is loading the whole page again) every time connectedCallback is called - at least that is what I assume. To be clear, my customElement disappears when I am changing an attribute.
However, I found out that connectedCallback is called more than once - I think it is called whenever another function has been executed. I know for a fact that it is called when attributeChangedCallback is raised though.
This is the reason I think it is attributeChangedCallback what causes the issue: That function creates the canvas, so when it is called again it will recreate the canvas again. Also: When my customElement is loaded for the first time, there is also a short period of time where it’s just not there yet. That looks just like my problem, only that my problem happens whenever an attribute changes, not just at the beginning.

This is the important part

class WixDefaultCustomElement extends HTMLElement {
  constructor() {
    this.table = createTable();

  connectedCallback() {

  attributeChangedCallback(name, oldValue, newValue) {
    if(name === 'data') {
      var data = JSON.parse(newValue);

      for(var iterator = 0; iterator < data.length; iterator++) {
        var row1 = element.row1;
        var row2 = element.row2;
        createTableRow(row1, row2, this.table);

  static get observedAttributes() {
    return ['data'];

Thank you for your help! I know that not everything might be clear so please just ask. I am really invested in the project and I might forget you don’t know something because I forgot to tell you.