Meta and Nvidia may be trying to position themselves at the forefront of the artificial intelligence, but both companies have been dogged by potentially costly investor lawsuits for years-old stock drops.