The claim is obvious if $n\in\{1,2\}$, so assume $n\ge 3$. Observe that
\begin{align*}
A &= \{n^3+i:i\in I\} \\
B &= \{n^3+j:j\in J\},
\end{align*}where $I,J$ are two non-empty disjoint subsets of $\{0,\dots,n\}$. With this, we have
\[
|I| n^3 + \sum_{i\in I}i \,\,\Big\lvert \,\,|J|n^3 + \sum_{j\in J}j.
\]By size constraints, it is evident that $|J|\ge |I|$. Now suppose $|I|$ does not divide $|J|$, let $|J| = k|I|+\ell$ for $1\le \ell \le |I|-1$. Notice that $k\le n$ (for $k=n+1$ to hold, the only choice is $|I|=1$ and $|J|=n+1$, not possible as they are disjoint). Thus,
\[
|I| n^3 + \sum_{i\in I}i \,\,\Big\lvert \,\, \ell n^3 + \sum_{j\in J}j - k\sum_{i\in I}i.
\]Note that
\[
\ell n^3 + \sum_{j\in I}j - k\sum_{i\in I}i\ge n^3 - n(1+\cdots+n)\ge 1
\]for $n\ge 3$. But then,
\[
|I| n^3 + \sum_{i\in I}i \le \ell n^3 + \sum_{j\in J}j - k\sum_{i\in I}i \Rightarrow n^3+2\le \bigl(|I|-\ell\bigr)n^3 + (k+1)\sum_{i\in I}i \le \sum_{j\in J}j \le \frac{n(n+1)}{2},
\]a contradiction.