Lightning tries to 'boxcar'/bundle/batch individual Server-Side calls, to save bandwidth (see https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_actions_queue.htm).
However, when it is batching two calls where the first is doing DML, and the next is doing callouts, then in the second call I get the well-known "You have uncommitted work pending. Please commit or rollback before calling out". Apparently because the batched calls run in one thread, and the DMLs from the first call actually prevent the second call from doing callouts.
Are there any Salesforce engineers here that can confirm that?
For now, the only ugly workaround I can think of is to ensure that in the Lightning Component, I work using setTimeout and $A.getCallback() to delay the second call so it is not batched with the first call.
Are there other solutions I could try?