Wio E5 CubeMX library include issues

I am using Wio E5 board for a LoRawan project and running the project FreeRTOS LoRa Wio E5 in STM32CubeIDE. When building the project as it is without changing anything in CubeMX it works fine. I could change the EUI values, region, etc… in the respective files and no errors after build and my board joins and sends data to TTN successfully.

When I try to enable I2C for my sensor communication or anything for the case in Cubemx and build the generated code, all the library references which were previously there just go away and so it throws errors such as no file or directory, macro, structure,etc… exists. Every library folder path is included for the compiler and in paths and symbols, and also all the source folders are well included in the source locations which is why it worked without changing anything using CubeMX.

What might be the issue?

After CubeMX regenerates code, the include paths might get altered. Check and update the include paths:

Go to Project Properties > C/C++ Build >Settings >Tool Settings > MCU GCC Compiler > Include Paths.

All necessary folder paths are present as relative paths. Will changing it to absolute paths solve the issue?