the positive part of the format is formatted for Millions. The negative part for Thousands. You can't have both mixed like that.
also, note what you are doing here... two commas before "M" and one comma before K. That's correct for for thousands but you have to remain consistent.
[>=1000000] $#,##0.0,,"M";[<1000000] $#,##0.0,"K";General
There is no magic to "M" & "K" They are merely textual references unrelated to real values.