If the Mac App Store sandbox answers your attempts to log in (and obtain a test purchase receipt) with a “Cannot connect” error then you have to first log in with the Apple ID associated to your developer account where the sandbox user is registered.
So open the Mac App Store and perform a simple customer log in with your developer Apple ID. After that obtaining a debugging receipt with your sandbox account shouldn’t return any “can’t connect” errors.
This little quirk cost me today a lot of time. First I assumed the sandbox was down. I only accidentally discovered the solution to this problem.