I implemented a weak form to define a floating potential and would like to know if anyone knows a good preconditioner for such a kind of problem.

A floating potential is a fixed but unknown potential, for example on a perfect electric conductor in an external field.
I used the examples from the iFEM notebooks on saddle point problems (e.g., how to implement Dirichlet BCs in this way).
This formulation comprises Lagrange multipliers, that represent the normal current density and NumberSpaces for every unknown potential.
It is also possible to impose currents through this formulation (see attached example).

I read in the literature that there should be efficient iterative solvers for this kind of problem but I cannot wrap my head around how to implement them in NGSolve because the sparsity pattern does not look similar to the saddle point problems for which iterative solvers are described (Stokes, Dirichlet BC).

have a look into the iFEM material:
(ngsolve.org documentation → interactive FEM course)
main file is iFEM.ipynb
go into
Chapter: Saddle-point problems
Section: Small number of constrains

It is a saddle point problem where the number of constraints is small. The constraint matrix is stored as a MultiVector, i.e. each row is a dense vector.

I ran this tutorial and adapted it but I could not figure out how to implement the floating potential correctly.
What I understood: the constraint should be similar to a Neumann BC, so we impose the current instead of the average displacement.
But then the potentials were not constant on the surface of the circles (which they should be but I believe that this constraint is not yet in the formulation).
I haven’t understood how I could implement this constraint.
My code is attached (unfortunately, my laptop broke down and I could not get the Jupyter extension running on the replacement device).

I appreciate your help; also if you know any other resource on the topic!

yes, you are right, I did not read the question carefully.

In this notebook there are two solutions:

use a very high (electric/dielectric) conductivity in the conductor. Here I used a direct solver, however most nogsolve preconditioners can handle the ill-conditioning of the system matrix.

use a global basis function, constant in the conductor and decaying in the first layer of the air domain. Expensive if you have many floating potentials.

a third solution would be to connect all vertex dofs inside a conductor to one dof. This is the preferred solution, but it would require a little C++ coding.