Thank you for mentioning that bug. I checked it myself and you are right - when participant_count is incorrect, then message is not visible in message’s author inbox.
Also, you are right that even if you explicitly add that param to create_posts - it is not set correctly.
This is because TopicCreate has explicit list of allowed params:
Today I will create a PR to Discourse to accept that attribute in import mode.
In the meantime, to not wait for latest version of Discourse, you can run at the very end of your script
Topic.private_messages.map(&:update_statistics) - this should correct all numbers