Youtuber biscuitsalive did just that and has some interesting feedback on the resulting footage.
While the GoPro will probably work in a pinch, biscuits lists three main areas where the GoPro can improve. I agree with about 99.9% with what he says, this is by no means a pixel peeping review, just a general outline to align expectations.
Obviously, the GH has more control over the shot, you can control focus, shutter speed, and many aspects that the GoPro was just not planned to do. This control has an impact on quality, sure, but it also has an impact on the creative choices you can take. Which brings us to the second point:
This is an obvious one, but a $2K GH5 takes nicer looking photos than $400 GoPro, and there are many factors contributing to that: THe GH5 shoots RAW, while the GoPro shoots JPGs; The GH5 has a bigger 4/3 sensor vs. the smaller 1/2.3 inch GoPro sensor, the better glass on the GH5; and the list probably goes on.
One thing that taking RAWs allow is pushing or pulling the images without losing too much data, and this definitely shows in the parts when the sky goes dark.
Remember that we mentioned that control was important, well, with the GH5, you can set your exposure time as you wish, say to 1-second exposure. While this, obviously, lets more light into the sensor, it also blurs any sudden movement. This means that your time-lapse footage will look more natural, and more pleasing to the eye.
Does that mean that you should not use the GoPro for time-lapse? Not at all. It simply means that you need to be aware of its shortcomings and expect footage accordingly.