It's fine as long as you warn of the drawbacks
As Andras Deak mentioned in comments under the question, a good long-term way to modify open-source libraries is to get your change accepted upstream so you don't have to manually merge or rebase your patch every new upstream release.
This of course requires them to be useful to multiple people and developed in a way that upstream might want to accept.
Using your own fork of the project before a pull-request is accepted upstream is a viable option, but if it doesn't get accepted you need a plan to either do something else or to maintain your own fork / patch.
I agree with TylerH's comment that such an answer would likely "be very well received if the answer included a warning, and, even better, a remark saying the author has opened a PR on said library to merge the new functionality into the library."
With a warning in the answer, future readers are less likely to get sucked into a maintenance problem without realizing the consequences of the road they're heading down. And if the changes can be plausibly upstreamed by someone, that makes it a lot better. It doesn't necessarily have to be by the author of the answer; someone else could fleshes out their ideas and do the actual work of sending a pull request or patch with credit to the OP. (A comment under the question would be appropriate for anyone who starts on that task, to let others know it's being done.)