Legend disabled after some number of elements

I need to plot a few lines with legend, atop of many background lines, and it seems that there is a limit of background lines I can have, while also having the legend. Is this a bug?

import holoviews as hv
hv.extension('bokeh')
import numpy as np

blue = hv.Curve([(0.1,0.1),(0.1,1)], label='vert').opts(color='blue')
red  = hv.Curve([(0.1,0.1),(1,0.1)], label='hor').opts(color='red')
c = blue*red

lout = []
for j in np.arange(-2,2)+24:
    bgk_curves = [hv.Curve(np.random.rand(4).reshape((2,2))).opts(color='lightgrey',line_width=.5) for j in range(j)]
    d = hv.Overlay(bgk_curves)*c
    lout += [d.opts(title=f"with {j} background curves")]
lout = hv.Layout(lout)
lout.cols(2)

And this is the output:

Any clue what’s going on?
Best,

For whatever it’s worth, I have a workaround. Just concatenate all background curves with nan’s inbetween each.

lout = []
for j in np.arange(-2,2)+24:
    bgk_curves = sum([np.random.rand(4).reshape((2,2)).tolist()+[[np.nan]*2] for j in range(j)],[])
    bgk_curves = hv.Curve(bgk_curves).opts(color='lightgrey',line_width=.5)
    d = bgk_curves*c
    lout += [d.opts(title=f"with {j} background curves")]
lout = hv.Layout(lout)
lout.cols(2)