A lawsuit against Walt Disney Co. has roped the entertainment giant into a long-running legal dispute over ownership rights to a visual-effects technology, potentially threatening the company’s ability to profit from the top-grossing movie so far this year.