For the past few years, profit has been on a steep upward trajectory at FedEx (FDX 0.11%), as desperately needed cost cuts took hold in its express delivery business. This allowed the company to routinely beat analysts' earnings estimates. As a result, FedEx stock has more than doubled since the beginning of 2013.

FDX Chart

FedEx stock performance, 2013-present. Data by YCharts.

However, FedEx reported disappointing results for its second fiscal quarter earlier this week, including its first earnings miss in a while. Furthermore, FedEx's debt is at a record high, and free cash flow is nonexistent. With FedEx stock still near its all-time high, shareholders should consider taking some profits.

Earnings growth slows

Adjusted earnings per share is still rising at FedEx -- but at a much slower rate than in recent years. In Q2, adjusted EPS totaled $2.80, up from $2.58 a year earlier. This fell short of the average analyst estimate of $2.90. FedEx's EPS growth rate of 8.5% was also far below the 20% compound annual growth rate it achieved between fiscal 2013 and fiscal 2016.

FedEx's recently acquired TNT Express subsidiary actually performed quite well last quarter, generating $90 million of adjusted operating income. However, profit growth has slowed dramatically in the FedEx Express segment, while FedEx's other two main business segments are facing severe margin pressure.

FedEx's problem children

Four years ago, FedEx's express delivery business was struggling after years of sluggish demand growth. As a result, the company embarked on an aggressive cost-cutting program starting in late 2012. This restructuring has worked like a charm, driving enduring margin expansion in the FedEx Express segment.

Cost-cutting has boosted profits dramatically at FedEx Express. Image source: The Motley Fool.

By contrast, the FedEx Ground and FedEx Freight segments have caused bigger headaches for investors lately. The freight business has been hurt by a combination of slow demand growth and rising expenses. In Q2, its operating margin contracted on a year-over-year basis for the sixth consecutive quarter.

Meanwhile, the ground business is benefiting from tremendous demand growth because of the rise of e-commerce. However, costs are rising at an even faster rate, as FedEx has had to invest huge sums of money to expand its capacity.

Three months ago, FedEx's management warned investors that the ground segment would face tough year-over-year comparisons for the rest of the fiscal year. Sure enough, while revenue rose 9% last quarter, FedEx Ground's operating margin fell to 10.5% from 13% a year earlier. As a result, segment operating income plummeted 12% year over year.

Can FedEx right the ship?

FedEx management has remained adamant that it is important to continue investing in the FedEx Ground business to drive long-term growth. Eventually, FedEx should be able to slow down the pace of investment there, helping profitability to recover. However, "eventually" could still be many years away at this point.

In the meantime, it is working to improve productivity and to better balance the trade-offs between growth and profitability. This includes dropping some customers who haven't been willing to pay enough for package delivery services, especially during the peak season.

The bad news is that until this investment cycle slows -- and the company finishes integrating TNT Express with FedEx Express -- FedEx isn't likely to produce much free cash flow. That's particularly problematic because FedEx's debt load has skyrocketed in the past five years.

FDX Free Cash Flow (TTM) Chart

FedEx debt vs. free cash flow. Data by YCharts.

FedEx faces other risks, too. While it passes fuel price increases through to customers, rising oil prices could encourage some customers to look for other ways to reduce their shipping costs. The strong dollar will put pressure on profitability at TNT Express, which mainly operates outside the U.S. Last but not least, the incoming Trump administration may implement protectionist policies that undermine global trade.

FedEx stock isn't especially cheap anymore, trading for about 16 times its projected EPS for the current fiscal year. Considering all of the potential headwinds it faces, the risk-reward trade-off of owning FedEx stock is looking increasingly unfavorable.