If the film is a flop, the producer and distributor are hugely affected, while the actors and the rest of the film's crew are hardly affected because they get paid well in advance of the film's release.
However, even if a movie doesn’t do well at the box office, there are many other sources of revenue that don’t show up in box office calculations, airline and hotel sales, soundtracks, video game tie-ins, merchandise rights, and other venues. There is also money made with merchandise deals and spin-offs.