If libreoffice has a different base template from office for things like line and paragraph spacing, then it might be possible that is causing the gaps.
For example, LO might save the file saying paragraphs use default template line spacing.
In LO, default line space might be 1.0, but in MSO the default might be 1.5 … so in MSO there would be gaps.
You could going through the file and specifying the spacing explicitly.
Or May be worth saving it in the open doc format ( .odt ) which is a common ground format. The .docx file type is proprietary to MS so unless you are using word itself then there will always be variations.