But it isn't semantically correct, though: it's not a meaningful sentence. If you use it you would probably mean to give an action of your earnest, but it still sounds awful as a sentence.
Also, sounding strange is actually the basis for the evolution of language; people tend to reject 'strange-sounding' words and phrases, and slowly those become unsemantic, even if they're grammatically correct. The important thing is being understood, so being semantic is as important as being grammatical.
It is meaningful, though. You even demonstrated in your second sentence how it could be used.
Duolingo is not an English teacher judging your eloquence, Duolingo accepts sentences objectively as translations of other sentences. If something is grammatically correct and not nonsensical, it should be accepted.
Why should you, though? It's the most accurate translation as far as I can see. It doesn't mean 'I'm a serious person.' 'I am in earnest' is unambiguous. I'm getting so bored with having to avoid correct translations because Duolingo gets it wrong. I can understand it when the course is new and people can't be expected to think of every possible variation, but to reject the repeated reports when everyone keeps telling them they've got it wrong is just foolish.
It might help to know that the English cognate "earnest" used to be a noun and a verb as well as an adjective. An "earnest" - now more commonly called "earnest money" - would be an advance deposit, like for an apartment that you're applying for. English lost the usage of "earnest" as a noun, but German kept it.
I wrote: that is serious for me, and was marked wrong. The "correct" answer was given as: that is serious to me. This is not exactly perfect English. An English speaker would be much more likely to say serious for me, rather than to me. A small detail, but you should change this.
Is there any difference between ''Das ist mein Ernst'' and ''Ich bin Ernst''? Is one describing your general personality whereas the other is describing your attitude towards one single incident?
I mean something like ''Mir ist gut'' and ''Ich bin gut'' is totally distinct as in I am feeling good and I am a good man.
But note that you must not capitalize "ernst" in the second alternative.
"Das ist mein Ernst" (using the noun "Ernst" (= "seriousness")) means "I am serious" in the sense that I assert that what I have said is to be taken seriously.
"Ich bin ernst" (using the adjective "ernst" (= "serious") describes me as a serious person.
Btw., there is also a German first name "Ernst", so if you capitalize "Ernst" in the second alternative, it would be "My name is Ernst".