Two observations--
This is the wrong question
Is removing duplication worth it when it doesn't reduce code size?
Doesn't really matter (see At what point is brevity no longer a virtue?). TLDR: Brevity doesn't matter, readability does.
The question you should ask yourself is-- did I reduce the number of code points that would require maintenance if I needed to change something? E.g. if you find a bug, will it be easier to apply the fix? If the code exists in two places, usually it is more work to fix (and to remember to fix it uniformly across the application).
Duplication can actually be better sometimes
Sometimes code duplication is actually better, e.g. if your system has a high number of dependencies and you are trying to improve the ability to deploy and update things independently. For example, if you have two microservices that need the same primitive string operation, it might be better to implement it twice rather than put it in a shared library, so that you can update each microservice independently without worrying about versioning the common library.