Generating mesh and applying bc for 3D linear elasticity problem using known nodes and tetrahedron connectivity

You probably need

mesh.topology.create_connectivity(mesh.topology.dim - 1, mesh.topology.dim)

or

mesh.topology.create_connectivity(mesh.topology.dim - 1, 0)

(or the other way around with the arguments in case I remember wrongly).

Having a fully reproducible code would have jogged my memory, but the code you posted is not runnable by anyone. For the future, please read Read before posting: How do I get my question answered? and adhere to those guidelines