Two things to note. First you don’t need the str( function since the datepattern( function output is text. Second and most importantly, you need to capitalize the “O” in of as in DayOfWeek. As you have it now Panorama is seeing just the “Day” token followed by the text string “ofWeek” which accounts for the output.
Note: Panorama X interprets the DayofWeek as a single text string so the output is “DayofWeek 2” instead of “SatofWeek 2” as in Panorama 6.