Michael clearly distrusted, if not outright suspected Fredo of treachery by the time he got him to come to Cuba with the $2 million. The whole point was to keep Roth off balance. Roth is obviously getting suspicious that Michael isn't putting his money where his mouth is, so the money has to be produced. But what better way to keep Roth believing that Michael is looking elsewhere for the traitor than to have the actual traitor brought to Havana with a suitcase full of money for Roth.

The whole Havana scheme was about Michael confirming his theory. He knew whatever investment he made was going to be lost, thus the reason for him telling Roth and the birthday guests about the rebel blowing himself and the police officer up. Being in Havana was all about sussing out who exactly had betrayed him, and I think the fact that it was Fredo who showed up with the money was all about Michael already having guessed that it was Fredo.

And remember Fredo almost spills the beans when they're having banana daiquiris. I suspect the entire purpose of that last outing between the two brothers was about Michael giving Fredo a chance to do the right thing and admit whatever his role was (perhaps Michael wasn't sure of the extent of Fredo's treachery).