I am doing my final year research under my supervisor for my Master's degree. I also wanted to do a short project to utilize my summer vacation. So, I approached a professor who was teaching a semester course, who seemed to be happy to supervise such a project. He agreed to guide me on a short project, that I wanted to start after the semester. Once the vacation started, I put a lot of effort into gathering knowledge about the topic he gave me. The topic was not in the syllabus, so I had to try a lot to understand it. After 2.5 weeks, he sent me a document with a rule in the institute that the project duration should be a whole semester. But I know I can't spend so much time during semester time for the project, so I suggested if the total duration can be extended more, so I can work during the 2 months of summer vacation and the next holiday, after this semester. He seemed interested and asked me if I have decided about my final year research. But once I told him that I am doing research under another professor, he got disinterested and didn't want me to work on this project anymore. I had mentioned it clearly in my initial emails, while asking for the project, that I want to work for 2 months during my holidays, but he accepted at that time.
I want to know if it is good practice to discuss my research topic and reveal my guide's name to other professors, or is there an unwritten rule to keep it secret.
I am confused as, why he accepted it first, and then after knowing there is no chance of me doing research under him, he rejected it? I want to know if I have violated any code of conduct/ any unwritten rule because of which he changed his mind.