Is totally fine, is literally the same engne, the part numbers only change because of the color schemes, but you can even swap internals parts between them.
You can go even better and use a R6s (not R6r) engine, i used one on my FZ6 S2, i put the R6 engine with no mods at all.
The difference on ECU doesnt concern the engine itself, as the only th ings connected to the engine are the stator, the spark plugs, the timing sensor and the coolant temperature sensor, and all those are the same between the bikes.
The ECU changes are more related to the external sensor and characteristics, for example, the ABS model, has a different ECU becauase it has to interface with the ABS ECU and a different tachometer.
The Model with inmobilizer, has a different ECU too because it has to connect to the inmobilizer antenna, etc.
But the enginres are the same.
I know some people that has installed S1 engines on S2 without any issue AT ALL. and the best example is my bike that has a R6s engine.
Hell i even got more horesepower with it at expense of some torque, because the only difference bnetween the R6s engine and the FZ6 engine, are the camshaft profiles.
I even swap the head from my original FZ6 engine on it, because one mounting point in the head with nothing to connect to, so it looked weird, but the engines are exactly the same.
Go for it, you will be ok.