Overscript and underscript in Sum

Why don’t overscript and underscript work in sum as it is written in Documentation?

\!\(\*OverscriptBox[
UnderscriptBox[\(\[Sum]\), \(i = 0\)], \(2\)]\)4^i

Your code uses these boxes:

 RowBox[{
     OverscriptBox[
       UnderscriptBox["\[Sum]", 
         RowBox[{"i", "=", "0"}]], "2"], 
     RowBox[{"4", "^", "i"}]}]

You need UnderoverscriptBox for this to work:

RowBox[{
    UnderoverscriptBox["\[Sum]", 
      RowBox[{"i", "=", "0"}], "n"], 
    RowBox[{"something", "[", "i", "]"}]}]

Overscripts and Underscripts are in general tricky. They have different meanings in different fields and involve complicated formatting.

If you run into an issue like this in the future, compare the formatting that works with the formatting that doesn’t work.

Thanks.