I had this same issue on my 2015 Macbook Pro and contacted Apple support about it. First trouble shooting steps were to reset the System Management Controller (SMC) and to reset the NVRAM or PRAM.
'''SMC:''' https://support.apple.com/kb/HT201295
'''NVRAM/PRAM:''' https://support.apple.com/kb/HT204063
Just throwing these links here in case they are helpful. In my case the issue turned out to be do to a warn trackpad cable. I took it to an Apple Store and they technician reattached the cable and placed a repair order. The temporary fix lasted about a week.
The repair order only cost $10 for the cable. The technician was able to include labor and a free display replacement free of charge. Very happy with the result. Currently waiting on my repair right now (estimated time is 5-7 days) but very happy to get a free new display as part of this.