I've encountered this problem myself.
It only happens when you return a single Record attribute, it does not happen when you return a List, so Alexandre Costa this why you could not reproduce the error.
The problem also does NOT occur if you return only an Id or a Join Record (several entities/structures).
I've only seen it happen in static entities.
Reading a previous Robert C., to reproduce the error the public action has to be consumed by another espace.
Using Service Studio 9.1.501.0, in personal environment, Server 9.1.301.0.
This problem Alexandre Costa wrote:
I believe that I have an open bug ticket on this as well.
Outsystems R&D was able to reproduce this issue and will fix it..... soon....
Outsystems's workaround solution: change the output parameter "list" data type to "record list" data type. You would need to upgrade all your apps, later outsystems will fix this issue and once again you need to do the reverse.
Unable to fix this myself so I just left it and work on other features and while I wait for outsystems to fix it.