Imagine consultancy C has a generic software for analyzing data S. Now C has a client C1 and from the software S it derives a software S1 to analyzed some specific data for C1. The overall dependency may be the same but the overall structure and purpose is specific to the need of client C1 which owns the IP (copyrights) over S1. Again, C has another client C2 and again they do something specific to analyze the data of that company C2 with software S2. C2 owns the IP (copyrights) over S2. Since both these softwares S1, S2 are derivative work of S is there any infringements betweeen C1 and C2?
If the copyright to S is owned by the consultancy C, and both S1 and S2 are derivative works of S, but not of each other, then C has the right to sell S1 to C1 and S2 to C2, and there is no infringement. However C should probably notify both C1 and C2 "The software created for you is a derivative work based on generic software created by C. C retains the copyright on this base software." That way neither C1 nor C2 will be mislead into thinking that they own the rights to S. I don't know if such notification is mandatory, but I would think it good practice at least.