Originally Posted by Napert
1. It doesn't work with any magisk version
2. Youtube installed from playstore works fine
3. I have tried magisk module, rooted and non rooted version and they all crash
If non-rooted crashes and YouTube from playstore works fine then the info you provided is not sufficient to find the culprit. Truth to be told, I cannot think of ANY reason why non-root will crash because it is just a 3rd party app. Unless your phone is somehow immune to google apps, in which case youtube from playstore should also crash.
You also said you have android 9.0 on redmi 4a, which is not the official firmware by xiaomi since redmi series are mostly forgotten and not given updates. Your last firmware should be marshmallow. In case you are on a custom ROM, xposed modules, substratum themes, magisk modules and all relevant info should also be present for troubleshoot.
Just a P.S. We do NOT have to help you. We are trying to help people who are willing to provide info, as much as we can. But it still does not mean that your issue will be fixed right after the info is provided even in case you haven't provided sufficient info, or your issue is a very specific issue that cannot be easily reproduced to provide a fix. Just my 2 cents.