Ciao
ho provato la tua query e funziona.

Ho provato velocemente su phpMyAdmin e per scrupolo ho creato uno script PHP e funziona anche lui.

es. con i miei dati

$array = mysql_fetch_assoc(mysql_query("SELECT SUM(id) AS totale_id FROM (SELECT id FROM mia_tabella LIMIT 0,10) as totale_id"));
echo $array["totale_id"];
45

array = mysql_fetch_assoc(mysql_query("SELECT SUM(id) AS totale_id FROM (SELECT id FROM mia_tabella LIMIT 0,20) as totale_id"));
echo $array["totale_id"];
190

Nel tuo esempio ho visto che manca l'alias dopo SELECT SUM(id), penso sia una svista...