On morphism spaces of $(\infty,2)$-categories failing to be $\infty$-categories As noted in Tag 01WZ of Kerodon, the morphism spaces of an $(\infty,2)$-category $C$ can fail to be $\infty$-categories, in contrast to the pinched morphism spaces of $C$.
This feels very counterintuitive to me, as the only difference between the former and the latter is that morphism spaces have in a sense "two times as many homotopies" than the pinched morphism spaces: for instance, the 1-simplices of $Hom(A,B)$ look like this:

i.e., a divided square with two 2-simplices, one from $id_Y\circ f$ to $h$ and then one from $h$ to $g\circ id_X$.
Meanwhile, the $1$-simplices of $Hom^L(A,B)$ look like the right-top triangle in this square, with a 2-simplex from $id_Y\circ f$ to $h$, and similarly the $1$-simplices of $Hom^R(A,B)$ look like the left-bottom triangle in this square, now with a 2-simplex from $h$ to $g\circ id_X$.
How should one think about this fact, intuitively? Say, is there some illuminating example illustrating what goes wrong for morphism spaces compared to pinched morphism spaces?
Second, I'm also wondering about whether this problem might be "rectifiable" in the following sense: is there an appropriate notion of "weak equivalence" of $(\infty,2)$-categories making the following statement true?

Given any $(\infty,2)$-category $C$, there exists an $(\infty,2)$-category $C'$ such that

*

*The morphism spaces of $C'$ are $\infty$-categories;

*The $(\infty,2)$-categories $C$ and $C'$ are weakly equivalent.


Edit: As noted in Tim Campion's excellent answer, the appropriate notion of morphism spaces for $(\infty,2)$-categories should be the right adjoint to the Gray tensor product. However, the morphism spaces defined by Lurie don't seem to be too far from the correct Hom, as they already encompass lax squares to some extent.
 A: It appears that Lurie has defined $Hom_C(X,Y) = Fun(\Delta^1, C) \times_{C^2} \{X,Y\}$ in Construction 4.6.1.1. This formula does not generally give the expected result even for strict 2-categories (unless $C$ is in fact a 1-category -- and Lurie remarks that this is the only case he expects the formula to be "correct"). In the strict case, it can be fixed by using the internal hom for the Gray tensor product rather than the functor category. That is, the correct hom-category should be $[\Delta^1, C ]^{lax} \times_{C^2} \{X,Y\}$, where $[X, -]^{lax}: 2Cat \to 2Cat$ is right adjoint to the Gray tensor product $X \otimes^{lax} (-) : 2Cat \to 2Cat$.
In the weak case, the Gray tensor product can be approached in several ways, not all of which have been compared. This will give a general, model-independent formula for the hom-category from $X$ to $Y$. But the answer to your second question should be no: one does not expect Lurie's "Hom" to be "correct" even after replacing with some weakly equivalent $C'$.
However, the phenomenon of Lurie's "Hom" failing to even be an $\infty$-category is something model-dependent. I'm not sufficiently familiar with his model for $(\infty,2)$-categories to say much more about it.
