Hello Carlo,
From my personal experience this is most of the time due to commits. Mendix submits all the transactions for the DB to process at the end of the MF, and the progress bar stops a few seconds after all commits are complete.
I’ve not found a way to monitor the commit times effectively, but you can check I/O graphs for spikes to see when large transactions begin/end.
Hope this helps.
This is a screenshot of part of the microflow:This is a screenshot of part of the microflow: