You've done the right thing, but if this is now gonna cause friction between the two and the main contractor isn't going to do the work anymore, then I would suggest you are then free to quote for the work.
In the 40 years I've been bouncing around the building game there was allways an unsung rule that you don't take work from the guy who you was working for because he was your contact to the clients, if he had'nt give you the work you would have never have met the clients anyway.