Not all developers are able to monetize their products. The amount of money you can earn by monetizing your codebase depends on several factors. Initially, the popularity of the software is an essential aspect that determines its monetary value. Apart from that, reliability and backing are other features that can influence your ability to monetize your code.
You can show reliability in various ways, for instance, the time you take to tackle issues or how often you maintain the code. It is highly unlikely that an unmaintained code will be able to obtain the user's backing and support.
Another instance of not being able to use your software for commercial purposes is licensing. For example, with the GPL license, redistribution and modification of open-source software become easy for the end-users but at the same time, you cannot ingrain your OSS solution into proprietary software and earn through a GPL license.
This is exactly why you need a commercial version of your product to be able to monetize it, which is available in the case of dual licensing.