The Maldives have a rule that if transit time is greater than 24 hrs then you need a new covid test not just their 96hr pre departure. My flight LAX-DXB-MLE is 16hr, with a 7 hr stop/layover in DXB then 4 hrs to MLE for a total of 27. Based on that data I need to retest however I was told on different boards that I was wrong that the term transit time what I think of as layover time - looking for an official answer.
This document states:
All tourists are required to hold a negative PCR test for COVID-19 conducted 96 hours prior the scheduled time of departure from the first port of embarkation enroute to Maldives.
If the tourist makes a transit during the journey, the initial PCR test will be valid if the transit does not exceed 24 hours.
If the tourist makes a transit exceeding 24 hours, the passenger must repeat the PCR test within 96 hours prior to embarkation at the port of transit.
It seems quite clear from "makes a transit during the journey" and "embarkation at the port of transit" that transit here means connection or layover.
So you should be fine with one single test taken within 96 hours prior to your scheduled time of departure from LAX.
Of course, in the current situation, avoiding travel would still be the best option.