I am trying to derive a closed form for computing the number possible outcomes of rolling $k$ dices such that the sum is $n$.

This seems to be the problem of finding number of positive integral solution of an equation $$x_1+x_2+\cdots+x_k=n$$ with $x_1,x_2,\cdots,x_n \in [1,6] $,but here a solution $(a,a,a,a,\cdots \text { k-times} )$ is not considered different.

Direct application of stars and bars gives a closed form $\binom{n-1}{2} \times k \binom{n-7}{2}$ but this is not working for all the cases, For example the case of $n=16$ and $k=3$,what exactly should I modify in my approach?