Multiple yaxis on subplots

I have two plots plots that are vertically stacked. For each subplot i want to have a separate y axis on the right hand side. However both axis show up on the bottom plot. They both connect to the correct plots, the positioning is just off. Any ideas?

Thanks

Can you share a reproducible example to help us debug?

var data1 = {
x: x,
y: data1,
type: β€˜line’
};

  var sr1 = {
    x: x,
    y: sr1,
    type: 'line'
  };
  
  var data2 = {
    x: x,
    y: data2,
    type: 'line',
    xaxis: 'x2',
    yaxis: 'y2'
  };

  var sr2 = {
    x: x,
    y: sr2,
    type: 'line',
    xaxis: 'x2',
    yaxis: 'y2'
  };
  
  
  
  var k = {
    x: xk,
    y: k,
    type: 'bar',
    offset:0,
    xaxis: 'x2',
    yaxis: 'y4',
    marker: {
        color: 'rgba(137, 159, 219, 0.43)',
    }
  };
  
  var layout = {
    yaxis: {
        title: 'X',
        domain: [0, 0.40]
    },
    
    xaxis2: {anchor: 'y2'},
    
    yaxis2: {title: 'Y' ,domain: [0.60, 1.0]},
    
    yaxis4: {
      title: 'yaxis5 title',
      anchor: 'x2',
      overlaying: 'y',
      side: 'right',
    },
    
    yaxis5: {
      title: 'yaxis5 title',
      anchor: 'x',
      overlaying: 'y',
      side: 'right',
    },
    bargap :0.01,

  };
  var data = [data1, sr1,data2,sr2,k];
  
  Plotly.newPlot('myDiv', data, layout);