A search for long-lived particles originating from the decay of
b
hadrons produced in proton-proton collisions with a center-of-mass energy of 13 TeV at the LHC is presented. The analysis is performed on a dataset recorded in 2018, corresponding to an integrated luminosity of
41.6
fb
−
1
. Interactions of the long-lived particles in the CMS endcap muon system would create hadronic or electromagnetic showers, producing clusters of detector hits. Selected events contain at least one such high-multiplicity cluster in the muon endcaps and require the presence of a displaced muon. The most stringent upper limits to date on the branching fraction
B
(
B
→
K
Φ
)
, where the long-lived particle
Φ
decays to a pair of hadrons, are obtained for
Φ
masses of 0.3–3.0 GeV and
Φ
mean proper decay lengths in the range of 1–500 cm.