Replacing bike frame on BMC Alpenchallenge AC01
If the new frame is the same frame model and year (the aluminum Alpenchallenge frame, that was used on a higher spec bike, and came with a carbon fiber fork), there should be no compatibility problems. Seat tube diameter, steerer diameter, bottom bracket shell, disc mounts, hub widths etc. should all be the same.

I note that the Alpenchallenge comes in both derailleur and internally geared hub versions. The internal hub version has a means to spit the drive side seat stay to install a Gates Drive belt and a eccentric bottom bracket shell. Obviously, make sure you are getting this version.

Other issues you might run into:

If the chain stays on both frames are not the same length you might have to get a different length belt.

You'll probably have to replace rear brake and shifter cables and housings as the run length will be slightly longer.

The medium size may have come with a slightly longer stem than the small, but that may not be a problem for you.

Don't forget to check for any special tools you might need.  Bottom brackets typically need installation tools, but I'm not sure about eccentric types.