So it only happens when you are pedaling - correct? Not when coasting?
If so, then that clearly indicates a problem with the drivetrain.
You said you already replaced bottom brackets and chain. So that eliminates a lot of stuff.
All you have left is the rear wheel.
Maybe you can try swapping out the rear cassette or even the rear wheel temporarily to see if that is the problem?