In the two phrases the verb plays two different roles, meaning that there is a different relationship between the subject and the predicate (there's a clue to the difference in the relationship also in the presence of "yn" in one sentence, but not in the other). In the second sentence, the predicate is a noun, and the verb thus functions as a copula, meaning that the subject and the predicate refer to one and the same thing and the verb is used to identify one with the other (i.e. "beth" = "y broblem"). In the first sentence, however, the predicate is a verbnoun (which is not quite a noun and not quite a verb), linked to the verb via "yn", so here the subject is not identified with the predicate (i.e. "beth" ≠ "bod"), rather the predicate indicates an action or state associated with the subject. All these different parts of the verb "bod" can be a bit confusing (it's one of the most complicated areas of Welsh grammar). In Irish, a related Celtic language, it's easier to grasp the difference because we use just two different verbs and have done with it, but in Welsh although the two verbs merged with each other many centuries ago (I think there are still traces of the separate copula to be found in Middle Welsh) they nonetheless left behind a few extra difficulties in the modern language.