Usually that is a bug of the DFPlayer Mini. There are ones that don’t return the number of tracks of the folder, which was requested, but the number of the folder which was played before. If nothing played before, this is the folder, which was put on the TF-Card first.
There is a topic about the known problems different players have. These problems were the reason why the Leiterkartenpiraten developed a player for the TonUINO.
As a workaround you can use the section modes, then the first and last track are taken from the card or you always play a short track (silence or you set volume to 0) before the number of tracks in the folder is requested.