Just always place while(1) on your code. Heck, I even have programs with 2 while(1) loops, just in case the first fails.
Some compilers may run through code memory (makes no sense). Sensible compilers will treat main() as any other function from the init code, and after main has ended (which it should never do btw), reset the software by jumping back to zero.
Anyway, as per standard debugging on MCU's "this pin doesn't work":
- Check your TRIS register settings (all outputs seems to be OK)
- Check your analog functions (analog by default, overrides digital functons).
- Check your re mappable I/O ( something like "PPS_Mapping_NoLock(0, _OUTPUT, _OC1);" makes no sense - where is the remappable pin number? Is it 0? Your comment says 5)
- Check your timer/PWM configuration. (Did you initialize before start?)
I don't have/use mikroC, so I don't know their library and how much it takes care of it's own, but I suspect you need to check your analog functions, PPS, and timer initialization.