Order a nested table with path index according to list_order in SQLite
Needed ordering may be performed by the next query:
WITH
cte AS ( SELECT *, CAST(list_order AS TEXT) as ord
         FROM items
         WHERE parent_id = 0
       UNION ALL
         SELECT items.*, cte.ord || '.' || items.list_order
         FROM items
         JOIN cte ON cte.id = items.parent_id )
SELECT * 
FROM cte
ORDER BY ord

https://dbfiddle.uk/?rdbms=sqlite_3.27&amp;fiddle=a7957edeabb5a9a1c9dff2d2e92ffe0c
If list_order values above 9 are present then you must apply zero-padding expression to its value. For example
WITH
cte AS ( SELECT *, printf('%04d', list_order) as ord
         FROM items
         WHERE parent_id = 0
       UNION ALL
         SELECT items.*, cte.ord || printf('%04d', items.list_order)
         FROM items
         JOIN cte ON cte.id = items.parent_id )
SELECT * 
FROM cte
ORDER BY ord

https://dbfiddle.uk/?rdbms=sqlite_3.27&amp;fiddle=52d6d43db054cb64754c37d3820c0b1e


do you have any trick to make the zero-padding dynamic? – alexandre9865

WITH
printf_format AS ( SELECT '%0' || LENGTH(MAX(list_order)) || 'd' AS format
                   FROM items ),
cte AS ( SELECT items.*, printf(printf_format.format, list_order) as ord
         FROM items
         CROSS JOIN printf_format
         WHERE parent_id = 0
       UNION ALL
         SELECT items.*, cte.ord || printf(printf_format.format, items.list_order)
         FROM items
         JOIN cte ON cte.id = items.parent_id
         CROSS JOIN printf_format )
SELECT * 
FROM cte
ORDER BY ord

https://dbfiddle.uk/?rdbms=sqlite_3.27&amp;fiddle=728695f41db0913bcde76370f70c885a