The fix is to remove the "ratsimp" from cflength.

Of course, the function is still unreliable, since it relies on approximation in the floor function, e.g.,
cf(2^(1/10)),cflength:28 => expt: undefined: 0 to a negative exponent.

A more reliable approximation is by using bfloat, e.g., cf(bfloat(2^(1/10))),fpprec:100; But you can't know in advance how many terms of cf that will give you.