I run an 11-32t on my rear wheel and completely forgot to check the specs of the 11-speed cassette I ordered for my smart trainer. Turns out the one I got for the trainer was 11-28t. Can I run the bike on both these cassettes without issues or should I just suck up my mistake and go and buy another 11-32t for the trainer to match that on my wheel?
Yes, you can run the 11-28 on the trainer while running an 11-32 on the wheel used when riding outdoors.
If the bike is set up correctly for the 11-32, the 11-28 will run identically on the 11 cog for both the trainer and the rear wheel, and when on the 28 on the trainer, it should be transparent to the smaller 28 cog (relative to the 32).
There is an unlikely possibility that gear shifting on the smaller cassette on the trainer may be affected on the larger cogs of the 11-28, but it should not be due to indexing (alignment of the rear derailleur [RD] with the cassette cogs). In the rare event that shifting is not ideal, I would still check the indexing first, as even though the cogs should be aligned the same on the trainer as it is on the wheel, sometimes tolerances just allow it to be off. If the indexing is good (as it should be) and shifting is still sub-par, it may benefit with an adjustment of the "B-screw" which adjusts the gap between the upper RD pulley and the cassette cogs.
I would give it a try without adjusting it first, and only adjust it if it really is necessary. If you do adjust the B-screw, you will need to reverse adjust it when using the 11-32 cassette on the bike because the upper pulley would be too close to the 32t cog if you don't.
You should not have any issue with your chain length.