Earlier this month, Walmart Inc. ended its grocery delivery partnership with a third-party courier firm. About a month earlier, the retail giant announced it had added four new companies to help with its online grocery delivery option.

A Walmart representative said in an email that its previous arrangement with Deliv was part of a pilot program that ultimately revealed that Deliv’s platform was not the best fit for Walmart’s program. But the issue highlights the fact that the convenience afforded by home grocery and restaurant delivery services is often belied by a number of tricky legal matters that in-house lawyers must navigate.