Repository: holoviz/holoviews

Issue:
Multilevel boxplot categorical axis alignment disrupted by overlay with HLine
#### ALL software version info
(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)
holoviews version 1.17.1
bokeh version 3.2.2

Issue found from exported html plot, but reproducing the issue in a jupyter notebook

#### Description of expected behavior and the observed behavior

I wanted to use hv.HLines in combination with a boxplot, but I wanted to keep the lines behind the boxplots for aesthetic purposes. Unfortunately, when the two plots are ordered such that the HLine is behind the boxplots, the categorical axis alignment is disrupted, essentially breaking the boxplot. I have another boxplot without a multilevel categorical axis and that is not disrupted, so this should be more related to the categorical axis than the boxplot

#### Complete, minimal, self-contained example code that reproduces the issue

```
import holoviews as hv
import pandas as pd
import numpy as np
hv.extension('bokeh')

data = {
    'Category': ['A']*40 + ['B']*40,
    'Subcategory': (['X']*20 + ['Y']*20)*2,
    'Value': np.random.rand(80)
}

df = pd.DataFrame(data)

box_plot = hv.BoxWhisker(df, ['Category', 'Subcategory'], 'Value')
h_line = hv.HLine(y=0.5).opts(color='red', line_width=2)

# Demonstrating the issue
# This should work fine
display((box_plot * h_line).opts(width=600, height=400))

# This produces the alignment issue
display((h_line * box_plot).opts(width=600, height=400))

```

#### Screenshots or screencasts of the bug in action

plot 1:
<img width="285" alt="image" src="https://github.com/holoviz/holoviews/assets/52087882/95e85395-36d7-4c7c-8754-9c2e56086405">

plot 2:
<img width="284" alt="image" src="https://github.com/holoviz/holoviews/assets/52087882/5ff09801-915b-47cf-b9f8-2ce098d5fc94">



Discussion:

Resolving patch:
diff --git a/holoviews/plotting/bokeh/util.py b/holoviews/plotting/bokeh/util.py
--- a/holoviews/plotting/bokeh/util.py
+++ b/holoviews/plotting/bokeh/util.py
@@ -4,7 +4,7 @@
 import re
 import time
 from collections import defaultdict
-from contextlib import contextmanager
+from contextlib import contextmanager, suppress
 from itertools import permutations
 from types import FunctionType
 
@@ -1192,14 +1192,15 @@ def dtype_fix_hook(plot, element):
     # Work-around for problems seen in:
     # https://github.com/holoviz/holoviews/issues/5722
     # https://github.com/holoviz/holoviews/issues/5726
-    # Should be fixed in Bokeh 3.2
+    # https://github.com/holoviz/holoviews/issues/5941
+    # Should be fixed in Bokeh:
+    # https://github.com/bokeh/bokeh/issues/13155
 
-    try:
+    with suppress(Exception):
         renderers = plot.handles["plot"].renderers
         for renderer in renderers:
-            data = renderer.data_source.data
-            for k, v in data.items():
-                if hasattr(v, "dtype") and v.dtype.kind == "U":
-                    data[k] = v.tolist()
-    except Exception:
-        pass
+            with suppress(Exception):
+                data = renderer.data_source.data
+                for k, v in data.items():
+                    if hasattr(v, "dtype") and v.dtype.kind == "U":
+                        data[k] = v.tolist()


Test patch: