It sounds like the Energia IDE is configured to use a different set of C++ language features than the Arduino IDE. If I enable verbose compilation output in the Arduino IDE 1.8.10, I can see that it passes these arguments to
avr-g++ which define what C++ language features are allowed and disable some errors:
-std=gnu++11 -fpermissive --Wno-error=narrowing
If you enable verbose compilation output in the Energia IDE (as mentioned at the bottom of your post) then you should be able to see how it is invoking the compiler, and you should be able to see that those options are either missing or different.
You might be able to look around in the Energia configuration files, find the place where it creates a command for the compiler, and change the options to be like the Arduino IDE. You might find people who faced similar issues on Energia-related forums or by contacting the developers.