Heya Dagmar,
PROBLEM
You are changing the composition of your OTU table by doing as you have explained. For testing, Lefse combines all the 'c__Actinobacteria' abundances together, all the 'f__Ruminococcaceae' abundances together for testing, all the 'G__Bacillus' abundances together for testing, and all the 'g__' abundances together, to check if any of these taxonomic levels are different between samples.
The issue is that all the unidentified 'g__''s (and 'p__'s, 'f__',s, 'c__',s etc) in your first set can be totally unrelated but will be combined by Lefse, and therefore your analysis involves spurious abundances - it's wrong!
A similar thing happens in your second example, where you have removed all the 'g__' OTUs, where the families they leave behind are grouped together without a corresponding OTU - closer, but still no good!
As a result, your outcomes change between runs.
SOLUTION
Add a column AFTER g__, which gives each OTU a unique number, e.g. k__Bacteria|p__Actinobacteria|c__Actinobacteria|o__Actinomycetales|f__Actinomycetaceae|g__|OTU_1234 . This will allow you to identify the biomarkers (use the table outputs and make your own graphics!) while still including the unknown taxa levels, and will give Lefse the data it expects.
NOTE, the results you get for unknown taxa (e.g. 'p__', 'c__', 'f__', 'g__' etc.) are still ~meaningless as you cannot attach identity to them, and (depending on your input) they will come from several unrelated sources. You could also give numbers to these unknowns to separate/partition them, but seeing as they are unknowable it will only tell you so much.
All the best!