A 400F engine will fit right into a 350F frame. The 350F production run was fewer, AFAIK, however, making them technically rarer. They were less sought after than 400Fs, however that has started to change in the past couple of years. Regardless, if you find a 350F frame you can make the swap.
There are a few other mods/things you'll have to do as well, depending on what exhaust you'll run. Stock 400F exhaust will require 400F pegs and brake lever and shifter linkage. More importantly, the tube to mount the brake lever is slightly different -- IIRC to put a 400F engine in a 350F frame you'll need to cut off a little of the tube from inside of the frame and then use it on the outside so that the brake lever mounts correctly. Might have this back arsewards though, but I think that's right. I did a long write up of this, either here or on DTT, if you feel like looking it up.