Is there any problem if one of secondary windings is left floating in a flyback converter
What happens if the 18V winding is left floating?

All windings will float - that's the beauty of a flyback design so, if in fact you mean you want to leave the 18 volt winding unconnected to anything then...
There shouldn't be any problem in a standard flyback circuit providing that the 24 volt output is properly connected and, the feedback stabilization is from the 24 volt DC output.