Since $n$ and $1$ are factors of $n$ the condition becomes $$\sum f_i^2=2n+6^2$$ where each $f_i$ is a divisor of $n$ distinct of $n$ and $1$. So if $$n=p_1^{n_1}p_2^{n_2}\cdots p_r^{n_r}$$ we should have
$$(p_1^{2n_1}+p_2^{2n_2}+\cdots+ p_r^{2n_r})+H=2p_1^{n_1}p_2^{n_2}\cdots p_r^{n_r}+6^2$$ where $H$ is in general an integer much greater than $6^2$ and because of, in general for positive integers,$$(p_1^{2n_1}+p_2^{2n_2}+\cdots+ p_r^{2n_r})\gt 2p_1^{n_1}p_2^{n_2}\cdots p_r^{n_r}$$ we would have $H+\Delta=6^2$ where $(p_1^{2n_1}+p_2^{2n_2}+\cdots+ p_r^{2n_r})+\Delta= 2p_1^{n_1}p_2^{n_2}\cdots p_r^{n_r}$.Then we can see that $n$ has not several prime factors (which one can show more formally, of course).
$(1)$ Case where $n=p^k$
►$p\ne2$ because if not then $2^2(1+2^2+\cdots+2^{2k-4})=2^{k+1}+6^2\Rightarrow2^2+\cdots+2^{k-4}=2^{k-1}+8$ which implies
$2^2+\cdots+2^{k-6}=2^{k-3}+1$, absurde if $k\ge6$ and a fortiori if not (because fraction= integer).
►►Let $n=p^k$ so $p^2+p^4+p^6+\cdots+p^{2(k-1)}=2p^k+6^2$. So if $p$ is odd then $k$ must be odd because if not we would have odd=even. If $k=1$ then $0=2p+36$ absurd, thus $k$ is odd greater or equal to $3$. Find this way, direct calculation gives the only example $n=27$.
$(2)$ Case of two prime factors.
If $n=pq$ then $p^2+q^2=2pq+6^2$ so $(p-q)^2=6$ and $n=q(q+6)$ wich is not admissible by the problem. When $p$ or $q$ have an exponent greater than $1$ we apply the reasoning above showing that it is not possible. And nor for three or more prime factors.
Consequently the only solution is $n=27$.