Did you try to debug and see where you are getting your error? I don't know which is the method you are talking about but I saw that the EditTableName I think it has some errors, the GetTableById is okay. Did you check if your entity/table has data?
What video did you see? It was this one? https://www.youtube.com/watch?v=Hd1p3kTVpP4
I would need to see what you are passing here

Because when you use the aggregate at the beginning you are replacing everything with the input parameter which makes the aggregate not relevant...

From the video that I shared you trying to give it a name but you are giving everything from the entity. Let me know if I am wrong...
And for that you will need to do this.
Add this attribute

Change this to text

And change the assignment to. Assign the name of the table to a the new table name(input parameter)

And add the aggregate data that was searched before

Let me know if that helps or if I am saying gibberish :D
And please I advise everyone to follow the proper training and I will advise you too in case you didn't do it.
Look at the many courses that OutSystems provides and every course is organized and has a path to follow.
https://www.outsystems.com/training/courses/
This one was the first that I did
https://www.outsystems.com/training/courses/114/developing-web-apps-outsystems-11/
Kind Regards,
Márcio