The bug is perhaps concisely illustrated with the following:
sage: var('k,n')
(k, n)
sage: function('f')
f
sage: sum(f(x,k),k,1,n).diff(x)
diff(f(x, k), x)*D[0](sum)(f(x, k), k, 1, n)
it shows that sage doesn't have a differentiation rule in place for symbolic sums and just applies the chain rule on the first argument (and undoubtedly on the others, but those are constants in x). I would expect that there is a ticket lying around about this (some care needs to be taken to do something sensible with the other arguments as well), but I wasn't able to locate one.