They went outside for a break amidst the unpacking, when the sister discovered her daughter chewing on the capsule.
The child had greenish, blackish smudges around her mouth, Ms Willemsen said.
She was taken to hospital and watched for three days before being released.
Holmes told police: "I feel bad that it got into contact with an infant, that's what really hurt. I feel like the silliest person ever."
He pleaded guilty to possession of cannabis oil.
Defence lawyer Jamie Waugh said Holmes came to Wanganui for a "fresh start".
"This was in his luggage and fell out," Mr Waugh said.
He said Holmes was "genuinely remorseful".
"The child is fine now."
Ms Willemsen said the consequences could have been "very, very serious indeed".
Judge Max Courtney said it was "inadvertent". "This could have had tragic circumstances to a young child," he said.
"I do, as I say, recognise it was inadvertent. It wasn't intentional or even just recklessly left lying around, but I do need to take into account that serious fact."
He sentenced Holmes to 60 hours' community work.