Your lack of a working minimal example makes it hard to give a solution
Sorry, I know, but I didn’t know to reproduce the situation.
but adding changing the way how the frame is added should improve things.
\startsetups[section:andrea]
\ifconditional\headshownumber
\scratchdimenone\dimexpr\headnumberwidth+\headnumberdistance\relax
\scratchdimentwo\dimexpr\headnumberdistance\relax
\else
\scratchdimenone\zeropoint
\scratchdimentwo\zeropoint
\fi
\startframedtext[offset=0.25cm,loffset=\scratchdimenone,rulethickness=0.01cm,frame=off,bottomframe=on]
\dontleavehmode\llap{\headnumbercontent\hskip\scratchdimentwo}
\headtextcontent
\stopframedtext
\stopsetups
look likes it solves all the problems! I really have no idea of what’s going on here. Luckily this mailing list is super friendly.
Manuals are cool, but I always miss the big picture that would allow me to generalise over a problem!
Thanks
Best
\defineheadalternative[section:andrea][alternative=vertical,renderingsetup=section:andrea]
\setuphead
[section]
[alternative=section:andrea,
numberwidth=1em,
before={\blank[0.5cm]},
after={\blank[1cm]}]
\starttext