I third Graham's suggestion.
Moving forward it is best to mock up your pieces before installing them on the bike. If you had tried to install your pipe onto the cyl before putting it on the engine you would have seen any possible clearance issues then. But it has been my experience that if the pipe isnt going onto the cylinder right it is usually my fault and not any actual clearance issue. Most of the time you cant use the pipe mounting bracket to hold the pipe on the bike while you attach the header to the cyl. It just wont work. You need to attach the pipe to the cyl then try to get the mounting bracket attached to the bike. Many times I end up needing to make a bracket to get the pipe to attach to the frame.
1) Get the cylinder properly installed and tightened down with the head. Some cylinder kits can have a little wiggle to them if you dont add in the sleeves to the stud holes.
2) ditch the exhaust studs and use some good hardened m6 bolts. I have had more problems with studs than ever stripped out any mounting threads. Just be careful to not miss thread your bolts.
3) use a thick crush gasket
4) mount the pipe to the cylinder but leave the studs a little loose so you can wiggle the pipe a little to try and get the rear mount set with the frame mount. If you can slip a bolt in to hold it, then do that and tighten up the header.
5) tighten down the rear mount. If it feels like it is pulling the pipe too much then stop and fabricate a bracket to get the mounts to work.
I have only had to modify a header flange once and it was due to it having been warped slightly and it was also not the correct pipe for the bike but I made it work.