Hello.
When you try to obtain information about “something” in AppleScript, it is pretty much like sending a database query.
So, you may have to refine the query in Applescript to get what you want.
Objects and properties in an application like Messages, are pretty much organized like a datamodel.
So and object, has properties, that may individually be viewed as objects, that has properties again, and so on.
It is a nice trick, to get familiar with the dictonary of an app, and try to understand how it all are joined together, it is also of great general value, because there is a lot of commonality in different apps, so when you have learned about one, then you know a whole lot about the others. This is of course most valid when it comes to the Standard Suites of a Dictionary that every app has. But there are still transferable knowledge and experience in the other Suites of a Dictionary as well.
In your code examples, you are really asking fro two different things, in the first you ask for the participants, which may be a kind of intermediary object, that contains a list or something with buddies, aka something that is to complex to be coerced into a string, so you’ll have to look at what a participant contains, and try to extract those values. (Try that.)
In the second example you ask for the id, which is simple enough to be coerced to a string.
A composite object, can in general not be coerced to a string, since it resembles a record.