There's nothing wrong here. What you're seeing is how the tool you're using has decided to represent its output.
In the TS Playground, you see this:

But if you take the compiled JavaScript code from there and put it here in StackOverflow's snippet, you see this:

class a {
constructor() {
this.COUNTS = new Set();
}
execute() {
this.COUNTS.add('a');
this.COUNTS.add('b');
console.log(this.COUNTS);
return { contas: this.COUNTS };
}
}
const x = (new a()).execute();
console.log(x);
But then if you open Chrome dev tools and look at the console output, you see this:

So it appears that different tools represent the Set in different ways in the console output, and some of them change that representation when the Set is inside of a JavaScript object. The Set should continue to work like a Set, regardless.
If you're building this object to send as a JSON string, note that the JSON representation of a Set object is just {}
. So you'll probably need to translate it into something serializable like an array, which you can do with the spread operator:
return { contas: [...this.COUNTS] };