When you close the programs on the iPhone 7, the screen is darker at first, and then it becomes brighter, should it be so?
It is possible that this is the work of the light sensor. It automatically adjusts the brightness to external lighting.
Some applications may not interact with this sensor and after they close, the brightness of the screen is adjusted.
To check, try disabling automatic brightness adjustment ( Settings – Screen and brightness – Auto brightness ) and again simulate the situation with closing applications.