AVG over the RANGE frame averages the days that had orders, not seven days:
WITH daily AS (
SELECT ordered_on, COUNT(*) AS n
FROM orders
GROUP BY ordered_on
)
SELECT ordered_on, n,
ROUND(AVG(n) OVER w, 3) AS avg_n
FROM daily
WINDOW w AS (ORDER BY julianday(ordered_on)
RANGE BETWEEN 6 PRECEDING AND CURRENT ROW)
ORDER BY ordered_on;
The week ending March 10, as AVG sees it:
That week held 2 orders, 0.286 a day, but AVG says 1.0 because it only saw two rows. Divide the 7-day sum by 7.0, or average over a calendar with zeros.
Write 7.0, not 7. In SQLite, / on two integers drops the fraction, so SUM(n) OVER w / 7 is 0 on every row here.
Then raise the start of the series yourself. The first six days have windows that reach back before the data starts, so say whether you report them.
In the editor, write AVG_7D: the 7-day average that divides by 7.