The common mistake is building too early or too big. First you need to validate that the friction exists, repeats often and costs enough time or money to justify a custom solution.
Custom development works best when the scope is narrow, the new product integrates with existing tools and adoption is measured from the first sprint.
It is also important to avoid unnecessary dependency. The client should understand what was built, how it evolves and which parts are truly critical.
The question is not whether building is cheaper than buying. The question is which option reduces total operational cost more effectively.