The formula you have is the correct one for beam deflection where the deflection is limited to planar motion. Your beam is not limited in that sense. Just as a thought experiment imagine your beam being loaded while supported laterally on both sites, i.e. like it was clamped loosely between the jaws of an eight foot wide vise. In that case the beam would deflect in one plane and your formula would be correct. But as the jaws of the vise were opened the beam would no longer stay flat. The top would deflect out of plane in one direction while the bottom went the other direction. At that point the deflection would be the result of both your deflection formula and twisting geometry. Neat formulas to estimate deflection in these three dimensional cases are not (to my knowledge) available and analysis of such cases involves the use of finite element analysis. Unless you knew what that was before you asked your question I expect you will find that analysis methodology to be too dense for your current math capability.
Although I’ve never used the tool there is something on the web called Beam Boy. It might be easy to find but unless you understand the assumptions that go into formulas you could end up automating the same analysis mistake that is shown in your post, i.e. applying a formula to the entirely wrong case. In trying to make an ‘un-engineered’ machine you are probably going to have to ‘over kill’ the size of supporting sections. If the 3” by ¼” rail was replaced by a 2”by 2” angle bolted to a 2” by 4” channel with some lateral supports then you might get something adequate to the need, but even then you would probably end up having to prototype and modify.