I commented that I don't think OP's turning up was a gerund, but I'm somewhat backtracking on that point now. Whatever - even if it's not formally a gerund, it looks quite like one. And there's been a general tendency over the past century or so for gerunds to replace infinitive forms.
The main factor controlling the gerund/infinitive choice seems to be the specific verb involved. Thus, looking at a simpler construction...
He enjoys swimming (not He enjoys to swim)
He wants to swim (not He wants swimming)
He likes swimming/to swim (both are okay)
There's also this from englishpage.com, pointing out that infinitives sound more abstract...
Gerunds sound more natural and would be more common in everyday English.
Infinitives emphasize the possibility or potential for something and sound more philosophical.
Learning is important (normal subject)
To learn is important (abstract subject - less common)
The most important thing is learning (normal complement)
The most important thing is to learn (abstract complement - less common)
To which I would add my own example...
I like you to kiss me (sounds dated, formal, starchy to me, and all 6 results are from long ago)
I like you kissing me (sounds perfectly natural, but all 58 results are from the past couple of decades)
Putting all that together, what it means is native speakers today like using gerunds wherever possible, whereas a century ago they liked to use infinitives. Actually, I just used those two forms to illustrate my point. Strictly speaking if we go back far enough, native speakers had no choice (because using gerunds like that simply wasn't grammatically possible).
As to whether there's any semantic difference, I think the answer is No, not usually. But when I consider the following pair...
I hate to eat alone
I hate eating alone
...I can easily convince myself it's more likely the first speaker doesn't actually eat alone very often. There's more "immediacy" in the gerund/continuous verb form used by the second speaker, which suggests to me he's currently eating alone (or at least, frequently does so).
Here's another related context where the infinitive/gerund choice definitely makes a difference. I know it's only because of the "when", but still...
Sports teacher: "Okay, you kids get changed and go outside while I finish my paperwork - I want you running/to run round the track when I come out".
EDIT: By way of explaining @user58319's assertion that the infinitive "implies some kind of control or influence". This just arises because in some contexts the implied subject is in fact the speaker...
"I don't like to smoke in bed" (so I don't)
"I don't like smoking in bed" (so please can you not do it)
Best Answer
For me, "the last thing we need" is used when we first don't really need anything, but all of the sudden we do need that as the last thing we could use or take. The second sentence you mentioned above is the same with the first one. For example: i have a problem with my PC, the last thing i could do is to have it fixed by an expert. the second example, i have few candles here, the last thing we need to do is to buy some more candles. Hope this helps