340 engine isn’t getting enough gas, why?

Same sized fuel line as was there for the /6? Probably too small.

And what fuel pump do you have? Can be bad out of the box or if a straight stock one, running out of capacity.

As said, start with fuel pressure test at the carb inlet and watch the fuel pressure gauge as you get to the 'weak' speed. Ought to stay in the 5-7 psi range all the time. If it does, then yo have eliminated the lines and pump and tank and can focus on the carb.