I know it's been 4 months, but it may help someone else. You need to do 3 main changes,
In your settings.gradle, you should be using a recent version of the workspace plugin.
In your rest-config.yaml file, you should specify a compatibilityVersion. Add / edit a line in the file to read:
compatibilityVersion: 6
Finally, in the -impl folder (where your rest-config.yaml file is), add a gradle.properties file and put the following line in it:
com.liferay.portal.tools.rest.builder.version=1.0.338
This was shamelessly copied from https://liferay.dev/blogs/-/blogs/restbuilder-transformutil-errors