There is a workaround in #1293 to use select + flushCache=true for queries like INSERT ... RETURNING ..., but it looks like this workaround doesn't behave the same way update does. If you look at DefaultSqlSession it marks session dirty only on update/delete/insert, but not on select meaning that query will not be rolled back.
Currently we have to use copy of DefaultSqlSession (and therefore copy of DefaultSqlSessionFactory) to mitigate this issue by marking session dirty on selects as well. Given that Postgres is quite popular database I assume many people might be affected by that.