This is an idiom. It does not mean that they were actually the sons of prophets, but rather, that they were a group of prophets. See how you translated this phrase in [2 Kings 2:3](../02/03.md). AT: "the group of men who were prophets" (See: [[rc://en/ta/man/translate/figs-idiom]])
Since they did not know what kind of gourds they were they did not know whether or not they were safe to eat. The full meaning of this statement can be made clear. AT: "but did not know if they were good or bad to eat" (See: [[rc://en/ta/man/translate/figs-explicit]])