The command you quote has never been able to give the effect you want. That command disables USB mass storage class devices entirely - i.e. you wouldn't be able to read the device at all (nor would you be able to write to it). It wouldn't be useful when you want to capture a forensic image.
Instead a way to go would be to stop the standard macOS automounter from mounting your USB stick as read/write. Then you could either mount it as read-only, or simply not mount it at all. Then you can take your forensic image.
A simple way to do that is to install Disk Arbitrator, which is a freely available utility. Ensure that the icon indicates either green (block mounts entirely) or orange (mounts as read-only) before proceeding to plugging in the USB stick.
If you prefer a command line way of achieving something similar, you could disable auto mounting by this command:
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist
Remember to test that this works with a test USB stick before using the real stick you want to create an image from.
You should be aware that this method is not "fool-proof". I.e. it will stop the system from auto-mounting the drive and contaminating it with Spotlight indices or similar. However, it does protect the USB stick from you doing stupid things. I.e. if you decide to use
dd to write to the drive instead of reading from it, you will be able to do just that.