I found a theorem for cubic, the theorem is a generalization of the Carnot theorem for conic. I'm an electrical engineer, not a mathematician. I don't know how to prove this result.
Let ABC be a triangle, Let three points $A_1, A_2, A_3$ lie on $BC$, three points $B_1, B_2, B_3$ lie on $CA$, let three points $C_1, C_2, C_3$ lie on $AB$. There is a cubic passing through the nine points $A_1, A_2, A_3, B_1, B_2, B_3, C_1, C_2, C_3$ if only if:
$$\frac{\overline{A_1B}}{\overline{A_1C}}.\frac{\overline{A_2B}}{\overline{A_2C}}.\frac{\overline{A_3B}}{\overline{A_3C}}. \frac{\overline{B_1C}}{\overline{B_1A}}.\frac{\overline{B_2C}}{\overline{B_2A}}.\frac{\overline{B_3C}}{\overline{B_3A}}. \frac{\overline{C_1A}}{\overline{C_1B}}.\frac{\overline{C_2A}}{\overline{C_2B}}.\frac{\overline{C_3A}}{\overline{C_3B}}=1$$

Any nine points lie on a cubic; the nine points in the question already lie on a cubic: namely, the degenerate cubic consisting of the union of the triangle's edge-lines. What the question intends is that the nine points, under the stated condition, lie on a second cubic (and therefore, determine an pencil of cubics). That is, whereas we expect nine points in "general position" to determine a unique cubic, the condition indicates that these particular nine points are in "not-quite-general position".
This can be proven with the approach I used in this answer to prove Carnot's Theorem for Conics. Namely, we assign coordinates $$A := (x_A, y_A) \quad\quad B = (x_B, y_B) \quad\quad C := ( x_C, y_C )$$ and define $$ A^{(i)} = \frac{B + a_i C}{1 + a_i} \qquad B^{(i)} = \frac{C + b_i A}{1 + b_i} \qquad C^{(i)} = \frac{A + c_i B}{1 + c_i} \qquad $$ then, writing $P_x$ and $P_y$ for the coordinates of $P$, we use a determinant to express the equation of "the" cubic through our nine points:
$$\left|\begin{array}{ccccccccccc} x^3 & x^2 y & x y^2 & y^3 & x^2 & x y & y^2 & x & y & 1 \\ (A^{\prime}_x)^3 & (A^{\prime}_x)^2 A^{\prime}_y & A^{\prime}_x (A^{\prime}_y)^2 & (A^{\prime}_y)^3 & (A^{\prime}_x)^2 & A^{\prime}_x A^{\prime}_y & (A^{\prime}_y)^2 & A^{\prime}_x & A^{\prime}_y & 1 \\ (A^{\prime\prime}_x)^3 & (A^{\prime\prime}_x)^2 A^{\prime\prime}_y & A^{\prime\prime}_x (A^{\prime\prime}_y)^2 & (A^{\prime\prime}_y)^3 & (A^{\prime\prime}_x)^2 & A^{\prime\prime}_x A^{\prime\prime}_y & (A^{\prime\prime}_y)^2 & A^{\prime\prime}_x & A^{\prime\prime}_y & 1 \\ (A^{\prime\prime\prime}_x)^3 & (A^{\prime\prime\prime}_x)^2 A^{\prime\prime\prime}_y & A^{\prime\prime\prime}_x (A^{\prime\prime\prime}_y)^2 & (A^{\prime\prime\prime}_y)^3 & (A^{\prime\prime\prime}_x)^2 & A^{\prime\prime\prime}_x A^{\prime\prime\prime}_y & (A^{\prime\prime\prime}_y)^2 & A^{\prime\prime\prime}_x & A^{\prime\prime\prime}_y & 1 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ (C^{\prime\prime\prime}_x)^3 & (C^{\prime\prime\prime}_x)^2 A^{\prime\prime\prime}_y & C^{\prime\prime\prime}_x (C^{\prime\prime\prime}_y)^2 & (C^{\prime\prime\prime}_y)^3 & (C^{\prime\prime\prime}_x)^2 & C^{\prime\prime\prime}_x C^{\prime\prime\prime}_y & (C^{\prime\prime\prime}_y)^2 & C^{\prime\prime\prime}_x & C^{\prime\prime\prime}_y & 1 \end{array}\right| = 0$$
A computer algebra system like Mathematica really helps to crunch the symbols, returning this:
$$\begin{align} 0 = &\phantom{\cdot}\;\left( x ( y_A - y_B ) - y ( x_A - x_B ) + x_A y_B - y_A x_B \right) \\ &\cdot\left( x ( y_B - y_C ) - y ( x_B - x_C ) + x_B y_C - y_B x_C \right) \\ &\cdot\left( x ( y_C - y_A ) - y ( x_C - x_A ) + x_C y_A - y_C x_A \right) \\ &\cdot|\triangle ABC|^7 \\ &\cdot(a_1 - a_2) (a_2 - a_3) (a_3 - a_1)\\ &\cdot(b_1 - b_2) (b_2 - b_3) (b_3 - b_1)\\ &\cdot(c_1 - c_2) (c_2 - c_3) (c_3 - c_1)\\ &\cdot(1 + a_1 a_2 a_3 b_1 b_2 b_3 c_1 c_2 c_3) \end{align}$$
(There must be a better way to derive this than by a brute-force calculation of a $10$-by-$10$ determinant. Of course, it helps to take convenient starting coordinates like $A=(0,0)$, $B = (x_B,0)$, $C = (x_C,y_C)$.)
The first three factors describe the triangle's edge-lines; their product represents the unique conic through our nine points, unless one of the other factors vanishes.
Of course, $|\triangle ABC| \neq 0$ for a non-degenerate triangle. Taking our points to be distinct guarantees that $a_i - a_j \neq 0$, and so forth. We may then draw the following conclusion:
To convert to the formula in the question, we note that the constants represent signed ratios of oriented segment lengths (in the grand Ceva tradition); a ratio is positive if the segments point in the same direction along a line, and negative if the segments point in opposite directions. Thus,
$$a_1 = \frac{|B A^{\prime}|}{|A^{\prime} C|} = - \frac{|A^{\prime} B|}{|A^{\prime}C|}$$
and so forth. An odd number of sign changes ensures that $(\star)$ matches the formula in the question. $\square$