Here's how I understand it. OP's buddy proposed the 0.4%, they ended up with 5 members in the team, OP, 3 other engineers and the guy who pitched the idea and is depicted as the asshole fitness biz guy (Billy), so 2% of the ownership of the startup the idea would potentially evolve into would end up in the hands of these initial team members
regardless of who runs the startup.
i.e. if after the weekend 4 members said 'that was fun, now let's go home', and 1 member said 'oh guys, can I use all the code and make it into a company?', then the other 4 guys would each have 0.4% ownership in that company even if they didn't put in any money or any time beyond the weekend, on the basis of their work that weekend. I think that's a sensible idea: 0.4% is not a lot, but it's a weekend of work, and if the startup ends up worth $10m or $100m then it's a nice kickback for a weekend's work. If it ends up being worth nothing, no biggie, after all you just worked there a weekend and didn't do anything after to make it a success.
In short, the 0.4% is a reward for anyone who decides 'I don't want to be part of the process of continuing this idea, but I want a small reward relative to what the idea I helped initialise could one day be worth'.
The issue is that when it's all said and done, the process to decide who'd want to turn this into a startup and who didn't looks to have been really authoritarian. One person turns it into a company and splits it 50/50 with a friend of his who wasn't even part of the startup team, and then declares himself to be the owner and leader of the gig which is absolutely ridiculous. A fair process would either be 'alright let's sit together as equals, decide on how we launch the startup, who becomes the leader, equity, salary etc, and anyone who isn't interested gets the 0.4% regardless'. Instead it was 'I'm the leader, I'm half the owner, the other half is someone you've never met, you can still be part of the startup but it's under my conditions and if you don't like it you can have the 0.4%'.
In short I can see the problem OP has with this, added to implications that Billy was being a condescending asshole.
Fact of the matter is however that (1) OP and the team can decide to use the code and run a similar project themselves if they want and iterate on it faster than Billy ever could given the former have all the expertise of not just development but the codebase as well and (2) if they were never interested in that, they'd still get 0.4% of Billy's venture (as long as the handshake deal is upheld i.e. which didn't seem to be put into question).
I think the handshake deal was sensible and I see absolutely no legal basis for Billy to be able to appropriate the work exclusively to his startup. In short I think OP had the power, met an asshole, still has the power. They still have just as much right to the work, still can run a startup without Billy and still can own 0.4% of Billy's venture.
edit: they ended up with a team of 9, billy and likely 8 devs, rather than 5, billy and 4 devs. Can't be bothered to adjust the percentages etc but the same story applies.