How many 8-tuples of $[4]^8=\{1,2,3,4\}^8$ are there s.t. every number in $[4]$ appears exactly twice, and $i$ never appears on the $i$th place for all $i\in[4]$?
There are $8!/16$ different tuples in $[4]^8$. I think the number of them with at least one fixed point is exactly like the number of derangements in $S_8$, but couldn't find a proof for it. Am I right? How shall I continue?
As you say, there are $\frac{8!}{16}$ tuples $p$ to consider. We must exclude those that have $p_i=i$ for some $1\leq i\leq4$. There are $4$ ways to choose $i$ and then $\frac{7!}{8}$ ways to permute the remaining numbers, giving $$\frac{8!}{16}-\frac{7!}{8}$$ However, any tuple with $p_i=i$ for two values of $i$ has been subtracted twice, so these must be added back in. There are $\binom 42=6$ ways to choose the two values of $i$, and then $\frac{6!}{4}$ ways to permute the remaining elements, giving $$\frac{8!}{16}-\frac{7!}{8}+\frac{6!}{4}$$ What about permutations with three values of $i$ fixed? These have been subtracted $3$ times, then added back in $\binom 32=3$, so we need to subtract them again. After that, we need to consider the tuples that start $1,2,3,4$. They will have been subtracted $4$ times, added back in $\binom 42$ times and subtracted $\binom 43$ times, so we must add them back in.
I leave it to you to finish up. (I get $864$ as the final answer.)