[Xiaomi Redmi Note 5 / 5 Plus ROMs, Kernels, Recove] dfkt_:
Write a proper gapps-config.txt, that should fix these issues. I've never had any troubles.

Here's mine, for "stock" packages, if it's any help:

# ##################################################################################################

# https://github.com/opengapps/opengapps/wiki/Advanced-Features-and-Options

# ##################################################################################################

# Testing without installing, will generate open_apps_log.txt file
#Test

# ##################################################################################################

# Include or Exclude GApps
Include

# Pico+
CalSync # Install Google Calendar Sync (except if Google Calendar is being installed)
DialerFramework # Install Dialer Framework
#GoogleTTS # Install Google Text-to-Speech (Micro+ on 5.0-, Pico+ on 6.0+)
PackageInstallerGoogle # Install Google Package Installer

# Nano+
BatteryUsage # Install Device Health Services (7.1+)
#FaceDetect # Install Face Detect library for photo apps
#FaceUnlock # Install FaceUnlock
#Search # Install Google Search (excluding excludes GoogleNow and PixelLauncher)
#Speech # Install Offline Speech Files

# Micro+
CalendarGoogle # Install Google Calendar
#ExchangeGoogle # Install Google Exchange Services
Gmail # Install Gmail
#GoogleNow # Install Google Now Launcher (requires Search)
#GoogleTTS # Install Google Text-to-Speech (Micro+ on 5.0-, Pico+ on 6.0+)

# Mini+
CalculatorGoogle # Install Google Calculator
ClockGoogle # Install Google Clock
Maps # Install Google Maps
Messenger # Install Android Messages (except on tablet devices)
#Photos # Install Google Photos
#TagGoogle # Install Google NFC Tags
#YouTube # Install YouTube

# Full+
#Books # Install Google Play Books
#Chrome # Install Google Chrome Browser
#CloudPrint # Install Google Cloud Print
#Docs # Install Google Docs
Drive # Install Google Drive
#Fitness # Install Google Fit
#GooglePlus # Install Google+
#Keep # Install Google Keep
#Movies # Install Google Play Movies & TV
#Music # Install Google Play Music
#NewsStand # Install Google Play Newsstand
#NewsWidget # Install Google News & Weather
PlayGames # Install Google Play Games
#Sheets # Install Google Sheets
#Slides # Install Google Slides
Talkback # Install Google TalkBack

# Stock+
#CameraGoogle # Install Google Camera
ContactsGoogle # Install Google Contacts
DialerGoogle # Install Google Dialer
#Duo # Install Google Duo
Hangouts # Install Hangouts
KeyboardGoogle # Install Google Keyboard
#PixelIcons # Install Google Pixel Icons
#PixelLauncher # Install Pixel Launcher (requires Search and Wallpapers)
#PrintServiceGoogle # Install Print Service Recommendation Service
#StorageManagerGoogle # Install Google Storage Manager
#VRService # Install Google VR Services
#Wallpapers # Install Wallpapers
#WebViewGoogle # Install Google Webview

# Super+
#CarrierServices # Install Carrier Services
#DMAgent # Install Google Apps Device Policy
#Earth # Install Google Earth
#GCS # Install Google Connectivity Services (excluding also excludes ProjectFi)
#GooglePay # Install Google Pay
#Indic # Install Google Indic Keyboard
#Japanese # Install Google Japanese Input
#Korean # Install Google Korean Input
#Pinyin # Install Google Pinyin Input
#ProjectFi # Install Project Fi by Google
#Street # Install Google Street View
#Translate # Install Google Translate
#Zhuyin # Install Google Zhuyin Input

# ##################################################################################################

# Prevent automatic Stock removals
#+Browser # Don't remove Stock Browser, even if Google Chrome is being installed
#+CameraStock # Don't remove Stock Camera, even if Google Camera is being installed
#+Email # Don't remove Stock Email, even if Gmail is being installed
#+Gallery # Don't remove Stock Gallery, even if Google Photos is being installed
#+Launcher # Don't remove Stock Launchers, even if Google Now Launcher is being installed
#+MMS # Don't remove Stock SMS app, even if Android Messages is being installed
#+PicoTTS # Don't remove PicoTTS, even if GoogleTTS is being installed

# ##################################################################################################

# Remove apps (uncomment a line to remove the app)
CMAccount # Remove CM Account
CMAudioFX # Remove CM AudioFX
CMBugReport # Remove CM Bug Report
#CMFileManager # Remove CM File Manager
CMMusic # Remove CM Music
CMScreenCast # Remove CM ScreenCast
#CMSetupWizard # Remove CM Setup Wizard (see Notes for CMSetupWizard)
#CMUpdater # Remove CM Updater
CMWallpapers # Remove CM Wallpapers
CMWeatherProvider # Remove CM Weather Underground

#Bolt # Remove CypherOS Bolt Browser
#CameraX # Remove CypherOS Camera
DashClock # Remove DashClock Widget (found in certain ROMs)
#GalleryX # Remove CypherOS Gallery
Hexo # Remove Hexo Libre CM Theme
#LRecorder # Remove LineageOS Recorder
#LSetupWizard # Remove LineageOS Setup Wizard
#LUpdater # Remove LineageOS Updater
Logcat # Remove OmniROM MatLog
#MusicX # Remove CypherOS Music Player
#OmniSwitch # Remove OmniSwitch recent apps switcher replacement

BasicDreams # Remove Basic Dreams Wallpaper
Galaxy # Remove Galaxy (also known as BlackHole) Wallpaper
HoloSpiral # Remove Holo Spiral Wallpaper
NoiseField # Remove Noise Field Wallpaper
Phasebeam # Remove Phasebeam Wallpaper
PhotoPhase # Remove Photo Phase Wallpaper
PhotoTable # Remove Photo Table Wallpaper

#Browser # Remove Stock Browser
#CalculatorStock # Remove Stock Calculator (automatically removed when Google Calculator is installed)
#CalendarStock # Remove Stock Calendar (automatically removed when Google Calendar is installed)
#CameraStock # Remove Stock Camera (Including CAF's camera application, Snap)
#ClockStock # Remove Stock Desk Clock (automatically removed when Google Clock is installed)
#Email # Remove Stock Email Client
#ExchangeStock # Remove Stock Exchange Services (automatically removed when Google Exchange Services is installed)
#FMRadio # Remove Stock FM Radio (not found on all devices or ROMs)
#Gallery # Remove Stock Gallery (automatically removed when Google Photos is installed)
#KeyboardStock # Remove Stock Keyboard (automatically removed when Google Keyboard is installed)
#Launcher # Remove Stock Launcher(s)
LiveWallpapers # Remove Stock Live Wallpapers
LockClock # Remove Stock Lockscreen Clock Widget
#MMS # Remove Stock SMS (automatically removed if Android Messages is installed)
#MzFileManager # Remove Stock FlymeOS File Manager
#MzPay # Remove Stock FlymeOS Pay system (this service is only available in China)
#MzSetupWizard # Remove Stock FlymeOS SetupWizard
#MzUpdater # Remove Stock FlymeOS Updater
#MzWeather # Remove Stock FlymeOS Weather (this service is only available in China)
#PicoTTS # Remove Stock PicoTTS
PrintServiceStock # Remove Stock Print Service Recommendation Service (automatically removed when Google Print Service Recommendation Service is installed)
#SimToolKit # Remove Stock SimToolKit
#SoundRecorder # Remove Stock Sound Recorder
#StorageManagerStock # Remove Stock Storage Manager (automatically removed when Google Storage Manager is installed)
Studio # Remove Stock Movie Studio
#SykoPath # Remove SykoPath Layers Manager (found in certain ROMs)
#TagStock # Remove Stock NFC Tags (automatically removed when Google NFC Tags is installed)
#Terminal # Remove Stock Terminal
#Themes # Remove Stock Theme Engine (will break the Settings Entry and can cause unexpected reboots on some ROMs)
VisualizationWallpapers # Remove Stock Visualization Wallpapers
WhisperPush # Remove Stock WhisperPush support