The idea of using のに there is completely correct, so please don’t worry about it. It expresses a contradictory result: even though the speaker was forced to buy icecream (expectation is to have some negative emotions), he was actually glad.
A textbook lists some situations where けど is ok and のに isn’t: where after けど you have request, command etc.
あなたのせいじゃない(〇けど・×のに)、アイスを買ってこい
even though it’s not your fault, go buy me an icecream
But this sentence doesn’t fall under any of those.
I think I’m just not used to seeing a て connection in the second clause, so I don’t know if it’s ok or not. Usually after のに you see some very simple statements of fact, so simple and obvious that they can be omitted colloquially.