Your approach is correct, but you have not gone far enough.

This problem can be solved by symmetry, without the need for integration. It is the same as working out the flux from a charge. See eg What is the electric field flux through the base of a cube from a point charge infinitesimally close to a vertex?

When the particle is at the midpoint B of diagonal AC it is at the centre of a unit cube. The cube has 6 sides, each subtending the same solid angle. So the flux of energy through any 1 side is $f_B=\frac16$ of the total flux from the particle.

When the particle is exactly at one corner such as C, it is at the centre of a cube of side 2, which is made up of 8 unit cubes. All of the energy crosses the outer faces, so $\frac18$ of the energy crosses the 3 outer faces of each unit cube, and $\frac78$ of the energy crosses the outer faces of the other 7 unit cubes.

Now we move the charge very slightly so that it is just inside one of the unit cubes. The flux through the outer faces, which are not close to the particle, does not change. It is still $\frac18$ of the total flux for the 3 non-adjacent faces of each unit cube. The flux through all 3 adjacent faces, which are close to the particle, is the remainder, ie $\frac78$. The flux through one adjacent face is $f_C=\frac78 \div 3=\frac{7}{24}$.

So the ratio is $$\frac{f_B}{f_C}=\frac{1/6}{7/24}=\frac47$$