How to compute tangent vectors on facets (2D surface parametrization)

Ok, I looked somewhat further and bumped into a post with the exact same issue;

As it seems, the current dolfinx version does not support to write the solution to a .xdmf file when a ‘Discontinuous Lagrange’ space was chosen. Whereas a ‘Continuous Lagrange’ space does not seem to be sufficient in this particular case, rather a possibility would be to switch to write the solutions with ADIOS & make use of the VTXwriter. Despite I’ ve also seen that it has been able to write the solution to a .xdmf file once was chosen to make use of the older dolfinx-0.7.0 version.

I would still prefer to write the solution to a .xdmf file and (luckily for me) am still working in this old 0.7.0 version.
Despite, a couple of errors are encountered and I was wondering what might be the cause. For example default_scalar type is not imported anymore in those legacy versions with;

from dolfinx import default_scalar_type

but it is rather imported with;

from petsc4py import PETSc
default_scalar_type = PETSc.ScalarType

Probably there are a couple of those changes. What i don’t understand is that if I look in the documentation of this old dolfinx version, it already seems to support for example finalize;
https://docs.fenicsproject.org/dolfinx/v0.7.0/python/generated/dolfinx.cpp.la.html?highlight=finalize#dolfinx.cpp.la.SparsityPattern.finalize
For what reason am I encountering this error in that case;

Traceback (most recent call last):
  File "/home/username/normals.py", line 223, in <module>
    nh = facet_vector_approximation(V=space, mt=facet_tags, mt_id=ft_id, interior=interior, tangent=tangent_flag)
  File "/home/username/normals.py", line 70, in facet_vector_approximation
    pattern.finalize()
AttributeError: 'dolfinx.cpp.la.SparsityPattern' object has no attribute 'finalize'

for this piece of code

    bilinear_form = dfx.fem.form(a, jit_options=jit_options,
                                 form_compiler_options=form_compiler_options)
    pattern = dfx.fem.create_sparsity_pattern(bilinear_form)
    pattern.insert_diagonal(deac_blocks)
    pattern.finalize()

To me this does not seem to make sense. Did anyone experience something similar?

Edit: Changing this to pattern.assemble() & removing every _cpp_object made it possible to write the solution to a .xdmf format with a Discontinuous Lagrange space. Still the pattern with the spots remains, like the case when the continuous Lagrange was chosen as before. Does anyone know why this is exactly the case. Why does it leave some spots empty and does not allocate a value to some nodes, although it does when using VTXwriter?