If this happens you can try the following solutions:
A) Try pressing the "Retry" button next to the mod in the Mods menu.
B) Go into the game's settings and scroll down to the bottom of the General tab. Then, ajust the "mod compilation timeout" slider so that it is more than 30 seconds.
C) Update your CrossOver installation! This fixed mod compilation for me.
D) This option is a bit more complicated. You can download & run the mod compilation software externally by building it yourself. Detailed instructions can be found
here on the PPG Mod Compiler GitHub page. This way, you can build a native macOS executable of the mod compilation server which will run faster and actually work properly!