why couldnt it?
are you trying to put the wires inside the frame? that may be a deal-breaker on the R5, without mods that would void the warranty.
best options are to either leave the wires external or send the frame to calfee for their internal battery/internal wiring frame modification.
Not sure if it would be the case with the R5, but on R3's the front derailleur hanger needed to be trimmed at the bottom which leaves very little 'flesh' in that area. The hanger on the R3 is aluminium and can be replaced if it breaks. The R5's is carbon and moulded on, so if something goes wrong after trimming it down......
But still, if you can make it work, you're still left with cable stops sitting on the frame like pimples
I know it is a different animal, but why not go for an S5, it has all the facilities to accommodate Di2