Power Line Communication
The ground clip of most oscilloscopes connects directly to the earth pin of the power plug.

When you have the scope connected the ground of your circuit is connected back to AC power ground.  When you disconnect that connection is removed and the only ground connection is via C28 to the neutral line.

That is a reasonable way to connect your circuit but it is not functioning correctly for some reason.